"the script on javascript"

SIFT THIS -- As part of the Bitsifter redesign, we decided to subtly enhance our navigation through the use of Javascript. You'll notice when you drag the mouse over the links in the left-hand frame that a small yellow arrow appears which indicates the active link. Additionally, text appears in the message bar of your browser window that gives a brief description of the link. Obviously, this is not ground breaking user interface work, but the simplicity with which the code is implemented and executed is worth talking about.

When the 'Net finally "got Java", everyone expected a new level of interactive web pages to emerge. Java, the ultimate programming language for the 'Net, was going to revolutionize web sites with all types of controls, animation, and other new functionality. Still, Java is a full-blown language complete with type declarations and explicit compilation steps. Early users of Java kept thinking their machine was hung when it was merely initialize the Java VM and the integration with web pages felt more like a plug-in. Enter Javascript.

Originally dubbed LiveScript by Netscape marketeers, the scripting language had absolutely nothing to do with Java. The name appeared when it became obvious that Sun Microsystems was getting tense about having a competing solution for web applications. As a matter of fact, Netscape had to go out and develop its own middleware technology called LiveConnect to even get Java and Javascript to talk with each other in a sensible manner.

From our simple use of Javascript, it's difficult to visualize the power of the language, so let's visit a site that has spent a bit more effort on implementation, Fire Engine Red. Fire up the site and first try to get the catchy name out of your brain. When you're done with that, examine how this web site designer has used Javascript to create a control panel to allow the user to switch between frames and no frames, toggle between a floating control panel, and turn the sound on and off. Almost all of this code is Javascript and if you don't believe me, you can view the source.

The "statelessness" of web pages provide one of the biggest challenges for Javascript since variables are likely to be trashed as eager users fly through generous usage of their FORWARD and BACK buttons. But Fire Engine Red solves this through the intelligent use of cookies to track user preferences. For a good example, throw some of the switches on the page, close your browser, and then return to the web site to find that the state of your controls are as you left them.

Short of state issues, Javascript is a flexible, forgiving language. Being a part of the framework of a web page translates into an easier development cycle for web site designers. Add the fact that the Javascript interpreter is also integrated into the browser (and also much lighter weight than the Java VM) and you've discovered most of the reasons why developers are leaning towards Javascript for their web applications. Unfortunately for Netscape, this seemless integration with the browser makes it next to impossible to market Javascript as a stand-alone product as evidenced by their fumbling around with their Java-based Visual Javascript project.

Meanwhile, Javascript's object-oriented syntax is likely to confuse page designers coming from a HTML-only background, but, trust me, if you've been waiting this long to figure out what object-oriented means, you now have reason.

mar. 13, 1998