Free Newsletters
Technology & Business Daily

InfoWorld
Log-in | Register

AJAX breathes new life into Web apps

Forget what you knew about JavaScript, DHTML, and the browser; it's a whole new ball game

By Peter Wayner
May 23, 2005
 

One year ago, Thomas Lackner didn’t ask much of JavaScript. When he sketched out the architecture to a Web application, he knew he could count on the browser language for “set-a-cookie hacks” and for loading images, but he turned to the server side for the heavy lifting. But when Google began launching highly interactive Web sites such as Gmail and Google Suggest, the scales dropped from Lackner’s eyes and he saw the opportunity.

Free IT resource

Open Source Business Conference (OSBC) May 22-23, 2007

Sponsored by OSBC

Free IT resource

Virtualization Insights from Top Experts - Learn how virtualization gets real!

Sponsored by Dell

Back to 'browser' report 

DOWNLOAD PDF

Click here to download InfoWorld's special report The browser reloaded


“It all clicked in my head the middle of 2004,” Lackner says. “I started trying to add AJAX components to every Web app I worked on.”

AJAX is the newly minted acronym encompassing a fresh vision of empowered browsers: Asynchronous JavaScript and XML. Before AJAX, Web pages displayed links, forms, and buttons. When a user clicked on a link or a button, the browser sent a message to a distant server asking what to display next. JavaScript would typically be used for nothing more than to check form inputs. Web pages were as static as pages in a book.

The post-AJAX browser can think on its own without saying “Mother may I?” to a distant server. Processing threads running in the background preloads page content. If a user clicks on a link or a button, the browser can update page content using JavaScript. Google’s Gmail, for instance, hides or displays parts of an e-mail thread without waiting for a response from its server, eliminating network lag. If information must go to the server, it too is sent by a background process.

Brendan Eich, the creator of JavaScript at Netscape, says the world is just now discovering what he imagined back in 1995. He says, “We [Marc Andreessen and I] always intended JavaScript to enable client-centric apps that did not have to reload pages from a server.”

A new kind of app
AdaptivePath’s Jesse James Garrett, who coined the AJAX acronym in an essay written in February, says that the response has been surprising. “Right now, it’s all so new that what we’ve got is a lot of excitement,” he says.

The excitement is understandable when you consider the advantages AJAX brings. For one thing, it greatly simplifies software distribution. Browsers load AJAX applications automatically. Customers are often reluctant to install custom applications, but most people can be convinced to visit a Web site.

The AJAX approach has several other advantages, as well. JavaScript running on the client reduces bandwidth and processing demands on the server. Well-designed code that is truly asynchronous also gives the server more time to respond to queries, reducing this load even further by spreading out peak demands. It even increases security by encrypting data on the client side, before it travels across the network.

The Basecamp project-management application from 37signals is a good example of a Web application developed using the new paradigm. Adding a new to-do item pops open a window to accept input without a round-trip to the server. But when the new item is saved, the browser still must wait to ensure that it was stored successfully. JavaScript code updates the server in the background while displaying the note, “Moving ... Just a moment.” There is still plenty of interaction with the server, but the JavaScript code speeds it by handling many of a user’s clicks.

David Heinemeier Hansson, a programmer at 37signals, says he’s concentrating on removing the lag time when a user submits a form. “If you have a Weblog and you add a comment, it will be updated on the server side in the background. Whenever you need to add or change content, you can do it without reloading.”

Some of the buzz surrounding AJAX has been generated by Web designers as well as programmers. AJAX’s flexibility is invigorating for Web designers because JavaScript can control any aspect of any images or type on a page. Fonts can grow or shrink. Tables can add or lose lines. Colors can change. Although none of these capabilities are new to programmers accustomed to building client applications -- or, for that matter, Java applets -- they are novelties to Web designers who would otherwise be forced to rely on Macromedia Flash.


Continued
1 | 2 | Next Page » 



 


 
InfoWorld Test Center Contributing Editor Peter Wayner is the author of thirteen books, including Translucent Databases and Policing Online Games.
 

TOP NEWS:


»  You don't know tech: The InfoWorld news quiz
Match your weekly tech news wits against our snarky quiz master

»  Antitrust review of Google-Yahoo deal no surprise
While serious antitrust problems are unlikely, both Google and Yahoo expected their partnership to be subjected to instense DOJ scrutiny

»  Top 10: Coreflood, more Microsoft-Yahoo, iPhone plans
This week's wrapup of the top tech news stories includes more Microsoft-Yahoo rumors, iPhone updates, Flash searches, Oracle's BEA roadmap, and more

»  Four 'important' Microsoft patches due Tuesday
Not rated "critical," fixes apply to "Elevation of Privileges" and "spoofing" bugs for Windows, Exchange, and SQL

»  Judge grants RIM a stay in Visto patent trial
Trial delayed from beginning next week while patent office studies validity of certain parts of e-mail provider Visto's patents as requested by RIM

»  Developers satisfied with Apple's enterprise work
Mac developers feel that Apple shouldn't try to make a broad attempt to win over enterprises and should instead focus on certain areas within the enterprise




Solutions to the Toughest IT Challenges in Remote Offices
Though small in size, remote offices face many of the same IT challenges as larger central offices. This Webcast zeroes in on the top line challenges to deliver information that can provide immediate benefits to your business. Sponsor: AMD and Dell

»  Click here to view this Webcast
  Zombie PCs Are Attacking Your LAN
A recent study showed that malware-infected zombie PCs are now a bigger threat to ISPs and Web infrastructure than DoS attacks. As this brand new IT Strategy Guide explains, an increased use of peer-to-peer techniques by the attackers has made it harder to fight back. Download now, compliments of Verio:

»  Click here to download now

- Special Advertising Partners -
WHITE PAPERS
 

» Technology White Papers Library

Technology White Papers by Topic

Technology White Papers E-mail Alert

Find out when the latest white paper is available:
 
 
INFOWORLD MARKETPLACE
 
» BUY A LINK NOW
 
SEE ALSO
• The browser reloaded


FIND PRODUCTS AND COMPANIES
» COMPLETE PRODUCT GUIDE



TECHNOLOGY INDEX
• Applications
• Application Development
• Security
• Networking
• Wireless
• Platforms
• Hardware
• Data Management
• Storage
• Web Services
• Business
• Telecom
• Professional Services
• Standards

TECH WATCH 


What's the 411 on GOOG-411?
Just as Google has become synonymous with "performing a Web search," 411 is understood to mean "information" -- as in "what's the 411?" I was thus surprised to discover, from a billboard, no less, that the king of search is taking on the ...

Apple HTML source reveals 'iPhone Extreme'
"This one's a stretch..." reports AppleInsider. Um, yeah. Reporting on HTML code sightings of product names could be called a stretch, but iPhone Extreme has a ring to it. Now, that sounds like the product Apple should have released first, rather ...

COLUMNISTS

Unified under law
Ephraim Schwartz's Column and Blog (InfoWorld) - In the litigious world we live in, deploying a unified communications platform in your enterprise could...
» MORE COLUMNISTS

MORE INFOWORLD BLOGS


Open Sources 
Product Management
When I joined MySQL four years ago, there was quite a lot of debate about product management. We didn't actually have ...

Zero Day 
Botnet herders tending smaller flocks
New research backs up the theory that botnet operators are keeping their networks smaller in a continued effort to keep ...



• Advice Line
• Database Underground
• The Deep End
• Enterprise Mac
• Geeks in Paradise
• Grid Meter
• The Gripe Line
• InfoWorld Daily
• Inside IT
• IT Troubleshooter
• ITXtreme
• Open Sources
• ProdBlog
• Real World SOA
• Reality Check
• Security Adviser
• SMB IT
• The Storage Network
• Tech Watch
• Virtualization Report
• Zero Day

ADVERTISEMENT


RESOURCE CENTERadvertisement 

GOVERNMENT IT & POLICY
'If you don't go after the network, you're never going to stop these guys. Never.'
From the State Department, All the News for Inquiring Minds
TechPresident, the Internet Citizenry's New Consensus Taker



Sponsored Technology Links

 
 
 HOME  NEWS  BLOGS  PODCASTS  VIDEOS  TECHNOLOGIES  TEST CENTER  EVENTS  CAREERS   About | Advertise | Awards | RSS | Contact Us 

Copyright © 2008, Reprints, Permissions, Licensing, IDG Network, Privacy Policy, Terms of Service.
All Rights reserved. InfoWorld is a leading publisher of technology information and product reviews on topics including viruses,
phishing, worms, firewalls, security, servers, storage, networking, wireless, databases, and web services.

CIO :: ComputerWorld :: CSO :: Demo :: GamePro :: Games.net :: IDG Connect :: IDG World Expo
Industry Standard :: IT World :: JavaWorld :: LinuxWorld :: MacUser :: Macworld :: Network World :: PC World :: Playlist