A popular example used for introducing a new language is the "Hello World!" program. This is perhaps the easiest program you could ever write. It simply displays the words "Hello World!" onscreen. Although terribly simple, it illustrates some introductory points of JavaScript. Listing 27.1 shows a sample "Hello World!" application.
<HTML> <HEAD> <SCRIPT LANGUAGE="JAVASCRIPT"> document.write("Hello World!") </SCRIPT> </HEAD> <BODY> … </BODY> </HTML> |