Wednesday, August 10, 2011

LEARNING JAVASCRIPT - FIRST PROGRAM PART 2 [EXERCISES] [en.wikibooks.org/wiki/JavaScript/First_Program]

 Welcome

  1. Introduction  1 - 2 - 3
  2. First Program  1

Exercise 1-1

Copy and paste the basic program in a file, save it on your hard disk as "exercise 1-1.html". You can run it in two ways:
  1. By going to the file with a file manager, and opening it using a web browser (e.g. in Windows Explorer it is done with a double click)
  2. By starting your browser, and then opening the file from the menu. For Firefox, that would be: Choose File in the menu, then Open File, then select the file.
What happens?

Exercise 1-2

Save the file above as "exercise 1-2.html". Replace the double quotes in the line alert("Hello World!"); with single quotes, so it reads alert('Hello World!'); and save the result. If you open this file in the browser, what happens?

No comments:

Post a Comment