“Hello World” Example (cont’d)
There is only one JavaScript statement:document.writeln("<H1>Hello World!</H1>");
The writeln method writes its argument into the current document
The script is in the <BODY> since it writes HTML code into the document; other scripts are written in the <HEAD> so they are processed and available in body
- Actually in advanced applications, when JavaScript is actually defined becomes quite tricky and is an example of how there are intrinsically undefined features in language
Scripts may be hidden from old browsers using arcane construct<SCRIPT LANGUAGE=“JavaScript” ><!-- A comment to a dinosaur…. Bunch of Exciting JavaScript Statements …..//script ends here --></SCRIPT>