JavaScript: The Other White Meat

by Heather Champ

Lately Web developers and designers have found many ways of using JavaScript to add greater interactivity on a Web page--from thinking about the possible uses for an interesting random rollover to small elegant mouse-over navigational bars (American Friends of the Israel Philharmonic Orchestra to alerting a user if form data input is invalid.

The appeal of JavaScript is that it's possible to create many client-side applications that are similar to CGI (Common Gateway Interface) programs. In the past the only way to include this level of interactivity was by incorporating forms or server push, etc. If you didn't have easy access to your "cgi-bin," typically the directory where Webmasters like to keep the forms-processing applications or scripts for ease of management and security, you had to present the scripts for approval to the Webmaster or ISP (perhaps for a fee) before you could proceed.

I'm ahead of myself. Any discussion of JavaScript is supposed to begin with the almost obligatory JavaScript is not Java. Java is a programming language, whereas JavaScript is an object-based scripting language. JavaScript is embedded into an HTML document and interpreted by the client's browser *. The language is still being developed and additional features are being added.



*Not so fast. All is not what it seems. JavaScript is similar to dframes in that it is very browser specific. Unlike frames with its awkward <NOFRAMES> solution, there is no easy way to display the complexity of the interactivity for a browser that cannot interpret JavaScript. Some noninterpreting browsers will skip the script completely, and others will quite blithely print the script onto an HTML document. Early releases of IE were wont to display the script for the once interesting, but now much abused text scroll. A user's browser must be a minimum of Netscape 2.02 or above, preferably 3.0, or Internet Explorer 3.0. In addition, Netscape 2.02 and IE 3.0 cannot interpret more recent developments in scripting concepts. Danny Goodman's JavaScript Pages has a table that demonstrates a few examples of who does what to whom and who won't play at all.


If you decide to incorporate JavaScript, you should look at your pages through as many browsers as possible--including those that will be able to interpret the scripts and those that will not. You might also want to consider something similar to what the American Friends of the Israel Philharmonic Orchestra site has included. The somewhat detailed tech page is more elegant than the small, informative Netscape and IE signposts and infinitely more polite than the "you dummy, why doncha download the latest whatever," "your browser must be this wide," or "please do the following before viewing my site."

Gamelan's Javascript section, Netscape's JavaScript Authoring Guide, JavaScr ipt QuickStart URLs, and JavaScript Tip of the Week are all worth a visit.

Whatever you do, don't click here.

Past installments of Design Diary