Module 1 Application Project.

This project will include a few different examples of JavaScript in action.



The above shows a text line in Javascript. Remember, in order for a line of JavaScript to be used, the browser must be able to read it or "see it". The follow line will be written for Javascript Version 1.5. If you do not see the line, please do not upgrade your browser! That version of JavaScript does exist and is supposed to be supported by IE 6.0, Netscape 6 and above. Even though I have IE 6.0, I can't even see the line. However if I open it in Netscape I can.

Did you see the line? If not look below. By adding the "ignore" feature to the script and removing the version specification of JavaScript, I can tell the browser to ignore the fact that I have specified JavaScript and to allow you to view the text without upgrading to a newer browser. To tell the browser to ignore it, I add the HTML comment code to the document.write. Above it, I add "< !--" and below it I add "//-- >". (NOTE: There are actually no spaces in the code! So the < and ! would be together and the - and > would be together. The spaces were added to allow the browsers to show them. Otherwise, yes you guess it, it would ignore them!) This tells the browser to ignore the JavaScript and show the text.

Almost seems to simple to be true, don't you think?

Now I'll add some simple JavaScript that is saved to an external .js file. By saving the JavaScript to a different file, I can easily insert the same JavaScript into multiple pages without having to retype the code over and over again. I simply tell the page to go to the source to retrieve the JavaScript and insert it into the current page at the place I specify.

So there it is, LP 1 JavaScript Application Project. I hope you have enjoyed it. See you in LP 2!