JavaScript Chapter 2




Skip to Chapter   1  2  3  4  5  6  7  8  9  10 

                                                              Chapter 2 -- Getting Started






Setting up JavaScript

All right, let's recap what we've learned.
You start JavaScript with a special HTML tag:
The <script> tag.
Inside the end of the <script> tag you should write language="JavaScript" to insure that poorly configured browsers can still use your JavaScript.
You don't need to understand exactly why to add the language="JavaScript" part of the tag... Just do.
Tell the browser when to stop reading javascript by using the </script> tag at the end of your code.

The alert() function

Now to learn the most simple yet entertaining command:
The alert() function
You've seen this function in action when you came to this page. Now, let's learn how to make it:
In between the <script language="JavaScript"> and the </script> tags type alert('Hello World!');
Go ahead! Try it!
You can use the alert() function to find and fix problems in your code.
You can also annoy a lot of people with this function!:)
Like every thing this code can be used for evil, and can really P**S people off. Needless to say, I'm not going to teach you how.
In the third chapter you get to practice variables!!!YAY!
The Basics DHTML Variables