Difference between revisions of "A Simple JavaScript Example"

From Techotopia
Jump to: navigation, search
Line 1: Line 1:
No programming book would be complete without an initial example application just to get the reader started, and this book is no exception. In addition to a quick confidence boost for the novice this serves as a good opportunity to check that the environment being used in for the rest of this book is fully functional.
+
No programming book would be complete without an initial example application just to get the reader started, and this book is no exception. In addition to a quick confidence boost for the novice this serves as a good opportunity to check that the environment being used for the rest of this book is fully functional.
  
Ever since the the first book on programming for the C language was published it has become traditional that the first example consists of writing code to display the words "Hello World". With this tradition in mind we will begin with such as example.
+
Ever since the first book on programming for the C language was published it has become traditional that the first example consists of writing code to display the words "Hello World". With this tradition in mind we will begin with such as example.
  
 
Using your favorite editor create an HTML file with the following content:
 
Using your favorite editor create an HTML file with the following content:

Revision as of 15:33, 9 April 2007

No programming book would be complete without an initial example application just to get the reader started, and this book is no exception. In addition to a quick confidence boost for the novice this serves as a good opportunity to check that the environment being used for the rest of this book is fully functional.

Ever since the first book on programming for the C language was published it has become traditional that the first example consists of writing code to display the words "Hello World". With this tradition in mind we will begin with such as example.

Using your favorite editor create an HTML file with the following content:

<html>
<head>
<title>My First JavaScript Example
</head>
<body>
<script type="text/javascript" language="JavaScript">
document.writeln( "Hello World" );
</script>
</body>