davesite.com / webstation / JavaScript


Introduction


Just a note, my new tutorials on Coding and Web Design will be found at CrazyButLazy Digital Designs, encouraging people to use HTML, CSS, and JavaScript together.


Need a better web host, or just starting out and looking for the perfect match?

iPage servers are amazingly fast and one of the best deals out there.

Check them out: iPage Web Hosting only $1.99/month!

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