This example demonstrates the use of namespaces in JavaScript. The basic idea is this, whenever you write JavaScript code, encapsulate all your code in a single global variable. This should prevent any naming collsions or other problems when you insert other JavaScript libraries into the page. For this example, all the Javascript code is contained in the Blue namespace.

In addition, this page also demonstrates how to handle events from an HTML select or combo box using JQuery. Selecting one a list name causes the list displayed to be automatically inserted into the document. View the source to examine the page in detail.

View Source