HTML and CSS Reference
In-Depth Information
developing a scripting language called LiveScript and eventually partnered with Sun
Microsystems. This partnership was mutually advantageous as it produced the Java
plug-in that enabled Web browsers to run Java applets in the browser, and the develop-
ment of LiveScript continued and was renamed JavaScript. However, JavaScript is not
the same as the Java programming language. JavaScript is much simpler than Java. The
two languages have more differences than similarities.
14.3 Popular Uses for JavaScript
The uses of JavaScript range from providing some “bells and whistles” such as simple
animation and fancy menus to functionality such as popping up a new window contain-
ing product information, detecting errors in a form, or detecting the browser version to
determine appropriate features that can be used. Let's look at some examples of some
of these uses.
Alert Message
An alert message is a popular technique used to draw the user's attention to something
that is happening. For instance, a retail Web site may use an alert message to list errors
in an order form or remind the user about an upcoming sale. Figure 14.1 illustrates an
alert message thanking the user for visiting the page. This alert message is displayed
when the user is leaving the Web site and surfing to a new site.
Figure 14.1
Alert message
displayed when the
user leaves the Web
Notice that the user must click the OK button before the next page will load. This
effectively grabs the user's attention, but it quickly becomes annoying if it is overused.
Popup Windows
And speaking of annoying, popup windows are instances of Web browser windows that
seem to appear mysteriously. These windows can also pop under the current browser
window so that you don't notice them until you are moving or closing windows on
Search WWH ::

Custom Search