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

Web Topics
All Articles
Scripting Languages

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

What are you missing by ignoring JavaScript?

Despite all the potentially negative implications of the discussion above, JavaScript is definitely worth learning.

If you're a consulting programmer or web developer, and you've managed to avoid JavaScript thus far, congratulations. I hope you've been spending your time wisely, and not learning Visual Basic for Applications, or Perl4, or PHP/FI, or any other language that has been replaced by more robust versions. I hope you haven't been learning a slew of proprietary APIs for extinct large-scale content management systems, or non-web software.

If you're an Intranet developer, or otherwise inside the firewall, I hope you haven't spent too much time learning proprietary and platform-bound languages such as VBScript. But at any rate, it's not too late to take advantage of JavaScript. Here are a few reason why you might want to learn it now:

  • JavaScript may well have the widest install base and impact of any cross-platform scripting language.

  • JavaScript is easy to learn, but powerful, and rewards the developer who invests some time into exploring the finer points of its many features.

  • If you already know Java, Perl, C/C++, or other, similar languages, you're already familiar with many of the fundamentals of JavaScript. If you're not familiar with those languages, the fundamentals may be learned quickly (though it may take some getting used to if your only experience is with Python or Visual Basic).

  • JavaScript may be used in both procedural and object fashion, and at varying levels of abstraction and design discipline.

  • Tied to the browser by way of Document Object Models of varying quality and depth of implementation, the trend is nonetheless strongly toward cross-platform, cross-browser compatibility and standards compliance (though you will likely have to work a bit to figure out which 90 percent of the standard is supported in which browser, and jury-rig the rest).

  • It's only fair to say that if you avoid JavaScript, you will also avoid a great deal of testing for incompatibilities in dozens of browsers. But what developer can avoid some testing? And what language is free of platform-specific quirks?

  • Due to the increasing acceptance of JavaScript-enhanced web sites, more developers are using JavaScript and DHTML on their sites.

  • The next generation of client-side web applications will be written in JavaScript (and already is).

Okay, okay -- so I've convinced you that JavaScript is worth learning. So what now?

How do I go about learning JavaScript?

First, decide what you want to use JavaScript for. Do you want to enhance traditional web sites? Do you want to provide enhanced functionality to server-driven web applications? Do you want your applications to run almost entirely on the client? What are your intentions with respect to using JavaScript and/or Dynamic HTML? Are you a designer or HTML production genius who wants to expand your capabilities? Are you a traditional developer wishing to build reusable components? Or are you the latest hire at a venture-funded startup who has realized that the JavaScript team gets all the glory? Regardless of what you want (or need) to do with JavaScript, there are resources for you.

If you're the sort who learns best by example and take pride in your ability to decipher code, start by viewing source on some of your favorite JavaScript-enabled sites.

If the JavaScript is referenced by <SCRIPT SRC="...">, simply cut the value of the SRC link and paste it into the Location: field of your browser (making adjustments for path information, as necessary). In many newer browsers, this will display the source intact, rather than running it.

If your browsing platform of choice is Navigator, use the "view-source:" pseudo-protocol as a prefix to the URL you created from the SRC value, to display the source. If you're on Unix/Linux, you can use the "lynx" text-mode browser to capture web files to local disk (use the -source switch and redirect the output to a file.) Then study the source and find a good JavaScript or Dynamic HTML reference manual, such as those written by David Flanagan and Danny Goodman.

If you're the sort who needs a more tutorial-oriented approach, there are many web sites that offer tutorials on JavaScript, from entry-level through advanced JavaScript and Dynamic HTML using the W3C DOM. In addition, there are several dozen books covering JavaScript and Dynamic HTML, although many DHTML books assume a basic knowledge of JavaScript, HTML, and Cascading Style Sheets. Be sure to check the publication dates and browser coverage, and ensure that the book you choose covers the versions of the browsers you need it to. Also check to see if the book has a companion web site or mailing list for further discussions of the technologies.

Once you've had a chance to dig in a bit, find a forum suitable to your tastes (whether Usenet newsgroup, BBS, mailing list or digest, or even chat) and start asking questions. Some forums have more stringent conventions with respect to the amount of work you are expected to have done on your own before asking for help, but most, if not all, expect you to provide a useful level of detail regarding your problem or question.

A frequent question on Webdesign-L, the mailing list that I run, involves the appropriate toolset for developers (whether handling loose markup, XML, Perl, JavaScript, or ColdFusion). In our next article, we will discuss what to look for in a development environment, and how to go about choosing the rest of your toolset when developing with JavaScript.

Steve Champeon is a recognized developer, author, and editor specializing in Web technologies. At his "day job," he serves as the CTO of hesketh.com, a Web services firm in Raleigh, NC.

Return to the JavaScript and CSS DevCenter.