Web DevCenter
oreilly.comSafari Books Online.Conferences.
MySQL Conference and Expo April 14-17, 2008, Santa Clara, CA

Sponsored Developer Resources

Web Columns
Adobe GoLive
Essential JavaScript
Megnut

Web Topics
All Articles
Browsers
ColdFusion
CSS
Database
Flash
Graphics
HTML/XHTML/DHTML
Scripting Languages
Tools
Weblogs

Atom 1.0 Feed RSS 1.0 Feed RSS 2.0 Feed

Learning Lab






JavaScript: Why You Don't Know More About It
Pages: 1, 2, 3

A casualty of the browser wars

Related Reading

JavaScript: The Definitive Guide, 4th EditionJavaScript: The Definitive Guide, 4th Edition
By David Flanagan
Table of Contents
Index
Sample Chapter
Full Description

During the browser wars, many improvements and extensions to the language (in addition to the DOM hacks and other features added under the rubric of "Dynamic HTML") took second fiddle in software reviews to UI enhancements and more powerful bookmark management tools. So, even if you learned JavaScript in the early days of Navigator 2, you may be unfamiliar with a good chunk of the present-day language. And to top it off, the most recent browser versions have greatly improved support for the W3C DOM recommendations. So, JavaScript has always presented an ever-rising learning curve to newbies and experts alike.



Even if you have been faithfully following the various vendor announcements regarding new JavaScript features and DOM enhancements, you may have thrown up your hands in disgust at the wide variance between implementations. Netscape went off in its own direction during the 4.x generation, with its LAYERS DOM. And Microsoft had similarly proprietary hacks (document.all, DHTML Behaviors) that presented this Faustian bargain: offering greatly enhanced functionality, but to a restricted audience, often targeting a single browser version.

And after all of that, even if you were lucky enough to learn one or both of the Netscape LAYERS DOM and Microsoft Internet Explorer's document.all DOM; time, audience, and budgetary constraints often forbid the full exploration of either DOM in the name of compromises and cross-browser workarounds.

On the other hand, if you were unlucky enough to have experimented with Dynamic HTML in the 4.x generation, you may have decided on your own that the lowest common denominator between the two major DOMs was too low for any useful applications. Some who reached this decision abandoned one or the other, in favor of whatever DOM offered the more powerful feature set for their needs. Still others simply gave up on DHTML as a platform for applications, and stuck to enhancing traditional web sites with UI and navigation hacks or primarily design-oriented uses.

Other advanced features of JavaScript required costly licenses (such as "signed scripts" that allowed the developer to manipulate the browser chrome in vastly more powerful ways, but which required each script to be signed using a certificate, often costing into the hundreds of dollars). For the average developer in the trenches, or for those simply wishing to extend their skillsets by noodling around, such barriers prevented a good deal of experimentation. That restriction may have been a sane requirement, but it also prevented many developers from using the features themselves.

Another reason why some have steered away from JavaScript is that once you publish a script to a web site, it is wide open for others to view and use, with little protection against theft other than copyright statements and unwieldy client/server license key hacks (where a script might be delivered dynamically, with some embedded code that disables it from working elsewhere) that are easily worked around.

Some less-than-ethical developers even resorted to using JavaScript obfuscators to encode their scripts and even to hide entire Web pages inside encoded document.write() loops. It's not easy to protect your intellectual property using JavaScript. Even though it's not much different than exposing your HTML or CSS to public scrutiny, many more ambitious developers prefer to keep their web applications from the roving eyes of their competitors.

As is the case with dynamic web sites of all kinds, the need to use server-side logic to manage cross-browser and cross-platform compatibility issues has added an extra level of complexity that many simply wished to avoid. The need to use PHP, mod_perl, Cold Fusion, ASP, and various other environments to produce or deliver code optimized to the target browser of the moment was a hurdle few wanted to deal with.

So, given all of these negatives, combined with the fact that Netscape, the Mozilla team, Microsoft, software reviewers, and the W3C haven't exactly made JavaScript and the DOM their top priority from a press relations standpoint, why has JavaScript survived, even thrived?

Some of the success of JavaScript can be attributed to the incorporation of commonly used routines, such as "rollovers" or "browser sniffers" into the GUIs of WYSIWYG HTML editors such as Macromedia's Dreamweaver. Rejected to some extent by developers, JavaScript came in the back way, via included scripts that were often well-written, but terse and difficult to read -- and some of which have suffered from a failure to foresee or anticipate the recent adoption of W3C DOM Recommendations.

Finally, if you're anything like the rest of us, you've probably been busy learning other Internet technologies, and in your case, perhaps JavaScript simply hasn't been your top priority. So, what have you been missing? What will you miss if you don't learn JavaScript now?

Pages: 1, 2, 3

Next Pagearrow