davesite.com / webstation / JavaScript


Introduction


JavaScript is a scripting language (i.e. a programming language) that is useful in making web browsers do tricks (as well as several other useful things). It was created by Netscape (now owned by AOL) before Navigator 3.0 was released. Recent versions of both Netscape and Microsoft's web browsers support JavaScript coding.

Basics of JavaScript

JavaScript code is typed into an HTML document just like tags. (If you don't know HTML yet, this is about the time you should learn it. Please visit my HTML tutorial.) Most JavaScript coding falls between the tags <script language="JavaScript"></script>. In order to prevent old browsers from displaying the code to your screen (wouldn't that look silly?) I would encourage you to place comment tags around your JavaScript falling between <script> and </script>. The code will still work fine.

<script language="JavaScript"><!--

 code here;

// --></script>

If you want to add comments in JavaScript, use either


 // for one line comments

 or

 /* for comments of two or
    more lines */

If you mistakenly use <!-- --> as a JavaScript comment you will be certain to run into trouble.




Back to the Guide

Next Section: Theory and Drop Down List URL Jump Box