AJAX accelerates Web applications
By Alexei White
,
Network World
, 01/16/2006
This vendor-written tech primer has been edited by Network World to eliminate product promotion, but readers should note it will likely favor the submitter's approach.
- Share/Email
- Tweet This
- Print
As IT increases its dependence on Web-based systems to deliver business applications, it sacrifices end-user productivity
and real-time updating of information. Web browsers have always been good at delivering software to remote users inexpensively,
but they haven't offered the rich-client functionality of desktop applications.
Enter AJAX (Asynchronous JavaScript and XML), a Web development technique that uses tools built into most Web browsers that enable rich-client
interactivity and real-time data micro-updates, or incremental updates, without the need for proprietary plug-ins. AJAX consists
of three building blocks: JavaScript (or ECMA Script) for computation, Dynamic HTML for presentation and XML HTTP for client/server
communication.
The key component of AJAX is XML HTTP, which allows a Web page to communicate quickly with a server after it has been downloaded
to a client browser. This is a dramatic departure from the traditional page-based model, which requires that an entire Web
page be reloaded for the information to be communicated between the client and the server.
While seemingly simplistic, AJAX opens doors for Web-application developers that had previously been shut. It relies on nothing
but the built-in browser internals. No extra software needs to be distributed to users, making AJAX an attractive option for
companies that are concerned about the security and logistical implications of distributing installed software to users.
The traditional Web-application architecture (sometimes referred to as the postback model) is inefficient because it wastes
communications bandwidth. Every hyperlink activation or button-press results in a postback (or reload) of an entire Web page,
when perhaps all that was required was a tiny block of text from the database. AJAX solves this problem with XML HTTP.
Using XML HTTP and JavaScript, a developer can make an asynchronous request for a block of information from a server without
needing to reload an entire page. The result is Web applications that react more quickly to user interaction.
For example, a user might want to see the details about a customer in a Web page. In a traditional Web application, the user
might have to click and wait for the entire page to refresh before seeing those details. In an AJAX model, the user could
click on the customer's name and have the data retrieved instantly from the server, then displayed directly on the Web page.
XML HTTP also addresses the data timeliness problem of traditional page-based application models. As soon as a Web page containing
some data is downloaded to the browser, it is considered "stale," or out of date. The browser has no idea whether that data
on the server has changed or is still accurate. This is a concern especially if a Web application has many concurrent users.
Using AJAX, it's possible to check that data is current before a user needs it.
All major browser platforms now support AJAX, including Internet Explorer, Mozilla FireFox, Netscape, Opera and Safari. There's
also a move toward standardization of XML HTTP, the core component of AJAX. Last year the World Wide Web Consortium formed
a Web API working group to develop a specification for HTTP functionality (which covers, in part, AJAX). This is happening now in large part because
of overwhelming response from the IT community in support of AJAX.
Comment