Build a website with javascript games and other dynamic content

Step One - Simple Javascript

With the following short script directly written into the body of a html page you get an short output of the program directly into the page

<script>

document.write('hello');

</script>

the ouput would be

The browser executes the write command immediatly during load as it interprets all the html command from top to bottom as well. When the program becomes more difficult you will probably seperate in functions and methods to run them at different events and not only everything once during load.


<script>

function say_hello()

{

document.form_name.textboxname.value="hello!";

}

</script>



This defined function can now be called at other times like on click on a button to fill something into a text box.


what is programmed then like


<input type="button" onclick="say_hello()" value="click to say hello">

or by click on a link to Say Hello so the code looks like

<a href="javascript:say_hello()"> Say Hello</a>

Originally I demonstarted that with a pop up window, but did you know that WebTVs are not able to see them?

Next step

 

AK
Start

My Games

Get Games

Build Games
space
1 - simple javascripts
2 - change form values
3 - statusbar & mouse
4 - change images
5 - preload images
6 - change location
7 - open/close windows
8 - other sources

Feedback or Questions

about me

 
 

Copyright by Armin Kielack 1998 last modified: