CCSU Spring 2001
JavaScript is a full featured object oriented programming language which is specifically designed to be used in creating DYNAMIC, INTERACTIVE Web Pages. These BEGINNING JAVASCRIPT DEMOS illustrate how to write simple JavaScript programs, and how to use even simple JavaScript to create DYNAMIC WEB PAGES.
To run these demos, simply click on the links below. Unless otherwise noted, all the demos will run on any of (in alphabetical order) Microsoft Internet Explorer version 4.0 or higher, Mozilla, or Netscape Navigator 4.0 or higher.
To learn how these demos work, you need to examine the source code. To view the source code, simply click on the links below. (Microsoft Internet Explorer will try to run the source code files as programs, and then you will have to click on "View Source" under the "Edit" menu to actually see the source code.) To save these demos in a runnable form for later use, save the source code files with an html extension instead of a txt extension (for instance save the first one as BeginJavaScript1.html) in a convenient place, and then, when you are ready, open the html files with any of Microsoft Internet Explorer, Mozilla, or Netscape Navigator. If the demos involve images, you will have to save the image files as well. Save the image files with a gif extension in the same convenient place. For instance, save the mushroom house as mushroomHouseBlue.gif
It comes as an unpleasant surprise to many beginning Web developers that the really fun features of JavaScript are usually BROWSER SPECIFIC. This means that a really neat DYNAMIC HTML page written for one browser using JavaScript may not run correctly on other browsers, and that other versions have to be coded for other browsers. We see this at the very beginning with the third and fourth demos. The third demo requires a late model browser, such as Microsoft Internet Explorer 5, Mozilla, or Netscape Navigator 6 to run. The fourth demo is a version of the third demo that runs on an older browser, Microsoft Internet Explorer 4. (In fact, it will run on higher versions of Microsoft Internet Explorer as well, but it will not run on ANY VERSION of Mozilla or Netscape.) Writing CROSS BROWSER DYNAMIC HTML pages, that is pages that will run on virtually ALL popular browsers, is something of a black art, and we will deal with it in later more advanced demos.