Next page | Contents page |

Exercise 2 - start a program

Put together the information from the previous three pages, to modify the HTML file by adding canvas and script elements plus an onload attribute.

The Javascript file, game.js, must contain this:


	function run()
	{
		alert("Hello World!");
	}

Run the HTML file in your browser and see what happens.

If you do not see a window saying "Hello World!" check that you have typed everything exactly as shown. In particular some fonts make it hard to distinguish between parentheses, (), and curly braces, {}.

Whenever you start to learn a new programming language you can expect to see a "Hello World" program.

Next page | Contents page |