Skip Links

Network World

  • Social Web 
  • Email 
  • Close

How an AJAX application works

By Thomas Powell , Network World , 07/17/2006

The key to AJAX is the XMLHttp Request (XHR) object, which can be invoked to send and receive XML and plain text data synchronously and asynchronously via HTTP. Whether implemented natively, in the case of standards-oriented browsers, such as Firefox, Safari, Opera and Internet Explorer 7, or as an ActiveX control in older versions of Internet Explorer, support is consistent enough so you can — with a little work — write cross-browser AJAX applications.

In April, the de facto use of the XHR object gained official support from the World Wide Web Consortium, a condition that likely will ensure the future of the technology for some time.

The general flow of any AJAX application is fairly consistent. First, you create an XHR object. Next, you form an HTTP request packet (either GET or POST) to be sent to a server-side program. In this request, you send the appropriate payload in the form of a query string or name-value pairs in a message body in the case of POST request.

You then send your request indicating whether it should block as a synchronous request or be performed asynchronously.

A registered callback function then will be invoked as the state of the request changes. This is important in the case of an asynchronous request so that the browser can “wake up” and deal with incoming data.

On the server side, the request will be read and an appropriate response often, though not required, will be sent back in XML format. Once the browser receives the response packet, the registered callback function will use the data, potentially parsing it out with various Document Object Model methods and making dynamic page updates as need be.


Return to main AJAX story
Partner Content
CA logo

CA Network & Voice Resource Center

Comprehensive Network & Voice Management Visit CA Network & Voice Management Resource Center and get insights into industry best practices, information that helps you to address your challenges.

CA Network & Voice Management Resource Center

whitepaper

Managing Voice Over IP for Successful Convergence

Voice over IP (VoIP) has much to offer in cost savings but some customers have concerns about VoIP call quality compared to the quality of traditional voice services. This white paper will help you learn how to take the right steps so that voice quality is assured.

Managing VoIP for Successful Convergence

whitepaper

The Changing Face of Network Management

Managing your network is serious business. This paper discusses the benefits of integrating configuration change-awareness into your network fault management solution

Download Whitepaper

Comment
Login
Forgot your account info?
Add comment
Anonymous comments subject to moderator approval. Register here for member benefits.
Have a NetworkWorld account? Log in here. Register now for a free account.

Videos

rssRss Feed
Save The Date!
What They Are Saying

why is all the hubbub about this guy blocking access to everyone else? Worst case they can contact the...- Anonymous

Join the Discussion