Global expressions and variables

<html> -- and then

the <HEAD> </HEAD> tags!

 

Now, for global function

  1. <SCRIPT language="JavaScript">
    This tag lets the browser know you are using JavaScript commands here.

  2. <!-- hide script from old browsers
    This makes sure older browsers don't display your script as text on the page.

  3. alert('whatever I want to say');
    This is your alert. Put your mesage inside the single quotes. Notice the semicolon at the end, this is what separates JavaScript commands.

  4. //-->
    Stops hiding the script from old browsers.

  5. </SCRIPT>
    Ends the JavaScript commands.

Here was my code.... (oops, forgot the comment stuff for old browsers - that's okay here, everyone using this page has javascript enabled.)

<SCRIPT language="JavaScript">


alert('Everything on this page deals with this alert');
alert('This document has to deal with everything that is not enclosed in a function, before anything else happens');
alert('Every function and every expression on this document sees every variable declared up here');
alert('If it is not inside a function');


</SCRIPT>