This article is taken with permission from the website of the book
Practical JavaScript
Programming.
The book covers JavaScript, LiveWire and LiveConnect and offers many
practical examples..
Since Microsoft introduced Internet Explorer 3.0, JavaScript has gained a quite a bit of recognition. The reason being? Well, now JavaScript is supported by the most popular browsers on the web: Netscape Navigator 2.0+ and Microsoft
Explorer 3.0 (aka IE3.0). If you have some knowledge on this easy to learn but powerful scripting language, I would like to encourage you to try some of the simple JavaScript snippets from this article.
In the chapter, I will show you some neat little scripts that you can use in your homepages and really surprise others who are not familiar with this language. Some of the examples presented here will be useful as well. For example, Now that we have diff
erent versions of the Netscape browser and only the
latest can handle certain plug-ins or JavaScript syntax, you might want to
know which version of the browser your visitor is using. If your visitor is
using Navigator 2.0 and you have JavaScript 1.1 on your page, the client's
browser surely will crash. Detecting a browser is a great example for
making sure that you can offer your page to all of your clients, not just
the ones who have the latest browser.
Another example would be displaying the latest update date of your Web page.
If your visitor knows when your page was updated, they can choose
whether or not to surf the page. Who likes to browse through month-old
information?
The same concept will apply to some of the other scripts that are presented
here. Just by cutting and pasting some of this code, you can make your site
a better looking and more enjoyable place to visit.