Essential Technology - Ajax Arrives for the Enterprise

Like vintage bowling shirts and wearing your pajamas to school, asynchronous JavaScript with XML, a.k.a. Ajax, seems to have begun as a West Coast fad. But it’s quickly gaining acceptance worldwide as developers look to design Web interfaces that hook users with their speed and ease of use.

But while clothing trends come and go, Ajax looks like it may stick around, offering Web developers a means to create rich clientlike applications on webpages without resorting to huge amounts of code or forcing users to download plug-ins. However, like every hot new Web technology, CIOs must hold firm against the regular barrage of "if Google is doing it, why can’t we?" and find the underlying value in Ajax for their particular companies.

Where Ajax Came From

Freely draggable satellite images on Google maps. Instant spellchecking in Gmail. They’re cool features. Admit it. The launch of tools such as those revitalized interest in both the online mapping and Web-mail markets. With a flourish, Google demonstrated that browser-based applications could support rich clientlike capabilities and performance—without the rich client.

The secret sauce was a clever combination of JavaScript and XML. XML-based data could be pre-downloaded into the user’s browser where JavaScript code could quickly perform operations on it—sorting a list of products or e-mail on the fly, for instance, or letting you drag map images around the screen—without the tedious back and forth between browser and server.

The idea was not new: Developers have been using JavaScript and locally cached data to offer rich interfaces since the ’90s. But the stars had not yet aligned. Most users still connected to the Internet via dial-up connections, making background data downloads tricky. Browser compatibility with JavaScript was hit or miss. And limited processing power on client PCs could throttle the performance of all but the most simple JavaScript applications.

Over time, JavaScript began to fall out of vogue in favor of server-side scripting—which guaranteed compatibility across browsers—and client-side development tools such as Macromedia’s Flash, which provided a clear path to rich applications even if it did require a browser plug-in to operate.

But in the past 18 months, JavaScript has seen a resurgence, driven by the likes of Google, Yahoo and even Microsoft. Just as important was the coining of a short, memorable and highly marketable term for the collection of technologies currently behind many of the most well-known applications. In a Feb. 18, 2005, blog entry by Jesse James Garrett, cofounder of user-experience consultancy AdaptivePath, asynchronous JavaScript and XML got a name: Ajax.

How Ajax Got So Smokin’

Once named, the hype followed. Ajax applications were hot, and the benefits they provided were easy to see, even for non-techies. Plus the whole idea of "client-free," rich Web applications fit well into an assortment of David versus Goliath prognostications about the future of software development, with Bill Gates often playing the role of the giant. Stories about Ajax and apps developed with the tools appeared everywhere, including publications such as The New York Times and BusinessWeek. Want to get some attention for your startup? Announce that you are developing your product in Ajax. Looking to warm up your r¿m¿Add Ajax to your skills list.

Ajax’s new branding also coincided conveniently with the dawning of Web 2.0, a vaguely defined movement that promotes the idea of the Web as a platform for easily remixable, highly flexible services—and Ajax looked promising as the glue that could hold those services together.

How Not to Get Burned

Even people deeply engaged in Ajax development suggest going slowly. Take a deep breath and learn what the technologies can and can’t do and what skills you need on staff to take best advantage of the tools.

Ajax, at least for now, is best suited to making user interfaces more intuitive and useful. Pop-up, context-sensitive information balloons (like those on Netflix.com), data lists that regularly update without reloading a page: These are the types of things that Ajax can offer right now to help you spruce up your browser-based tools.

Dave Jenkins, CTO at online outdoor equipment retailer Backcountry, used Ajax to add a feature to a browser-based ERP application: When a customer-support representative closes out a support ticket, the line on the screen blinks yellow twice and then fades away—a simple but effective visual cue that something has happened to the data. Jenkins argues that this is far better than the screen simply refreshing and the user noticing that the data has disappeared.

But even the simplest-seeming features can be daunting. Creating solid Ajax-based applications requires in-depth knowledge of JavaScript plus sufficient back-end database mojo to make sure everything works.

On the positive side, the flurry of interest in Ajax has resulted in a mini-boom of commercial tools and open-source kits designed to ease Ajax development (see "Ajax Online Resources," Page 44). Andy McCown, a lead developer at international advertising firm Chiat Day (which is currently testing Zimbra, an open-source, Ajax-based e-mail/collaboration tool), says the company first began looking at Ajax in 2004, but at the time there were few libraries available to help developers create their trial applications, forcing everyone to roll their own toolsets. And at the time, Ajax’s value proposition wasn’t there. But, he says, "Ajax has come on very strong in the past six months. It’s changing what people expect out of Web applications. We have to consider those expectations now." He points to the Script.aculo.us JavaScript libraries and the Prototype JavaScript framework as good examples of tools now available to help developers get up to speed with Ajax.

But even while they need to pay attention to the opportunities Ajax offers, enterprises should realize that browser-based JavaScript support is still fraught with potholes, particularly if you want to work across platforms such as Windows, Unix and the Macintosh as well as across browsers such as Internet Explorer, Safari and Firefox.

Sachin Shah, senior product manager at online job-listing site SimplyHired, says companies must make sure their Ajax features can downgrade gracefully if they’re going to expose their sites to the general public. Users, for instance, might be running an incompatible browser or may even have JavaScript turned off as a security precaution. But providing the downgrade capability—so a clever Ajax animation can also appear as plain text, for instance—makes the development process more complicated.

Even Ajax enthusiasts say caution is necessary, at least for now. "Long term, I’ll probably be using Ajax everywhere I can," Backcountry’s Jenkins says. But for now he plans to keep most of his experiments in-house, where he can control the user environment closely, for instance, making sure users are all on the same browser versions and all have JavaScript turned on.

Jenkins also says developers need to keep in mind that Ajax isn’t an all-or-nothing proposition. For instance, he points to a browser-based ERP client that Backcountry developers built in part using asynchronous JavaScript, but without the XML. The application uses the Postgres open-source database on the back end, Jenkins says. "I know where all the data fields are," he adds. "I don’t need all the XML fields"—a situation that simplifies development.

Security is another issue. While the foundational pieces of Ajax aren’t new, their widespread use in combination is, and the security ramifications of that are not completely understood. Suffice it to say that Ajax is vulnerable to the same things as are the base components: JavaScript and XML. Then add a few other vulnerabilities. For instance, according to the vendor, Scalix’s Web Access e-mail client is careful to clear traces of itself from the browser’s cache once a session ends, preventing thieves from rummaging through your e-mail messages once you leave. Use of a JavaScript obfuscator can also help protect the intent of your code from prying eyes.

Where Ajax Is Going

The exact direction Ajax takes from here on is anyone’s guess, although it’s a safe bet that frameworks and tools will rapidly mature and diversify. Microsoft, for instance, is working to release a set of integrated tools called Atlas next year that will combine Ajax with elements of the Visual Studio and ASP.Net toolset. (And the company is promising that it will maintain cross-platform compatibility on the browser side.)

Whether all the new development options create a scenario where users revolt against overused Ajax widgets—much as they did the "blink" tag—remains to be seen. For now, however, commercial applications such as the Zimbra and Scalix e-mail systems are showing Ajax to good effect—and helping pave the way for enterprise-class development frameworks.

Related:

Copyright © 2006 IDG Communications, Inc.

Survey says! Share your insights in our 19th annual State of the CIO study