| JavaScript Course |
|---|
A command, in a language that a computer can understand, telling it to do something. If you write in english the computer will not understand you. One of the languages your computer understands is called JavaScript.
To illustrate that your computer does not understand english you will be asked to type in a command in english and ask the computer to execute it. This should generate an error message. (By the way, when the error message is displayed you should make sure that the check-box entitled "Ignore further script errors on this page " is NOT checked. Otherwise your scripts will not do anything for the rest of this page. If you think you have this problem refresh the page.)
Type in an instruction in english in this box and then click on the execute button:
Did the computer understand the instruction? Probably not unless your english is like JavaScript.
Now let's look at a simple Java Script instruction. The box below
contains the instruction alert("hello")
Click on the execute button and see what happens.
What happened? The computer should have understood this instruction and executed it. It should have displayed a small box with the word Hello in it. Try putting alternative text between the inverted commas and executing it again.
Did it display what you expected? Have you figured out what the alert instruction does?(Lecture notes)
The alert instruction displays text in a box on the computer screen. This text is considered to be output from the computer. The text must be placed between inverted commas, which are placed in brackets. Make a note of the instruction and what it does.
Enter an alert instruction to type anything you like in the box below and press execut to see if it works. Remember to spell the instruction correctly, not to use capitals when writing the word alert and not to forget your brackets or inverted commas. alert("anything at all, at all")