Magazines, Books and Articles

Saturday, August 22, 2009

A for Ajax, Part 8: The XMLHttpRequest object

Part 1: Asynchronous and Synchronous requests

“The XMLHttpRequest object is a data transport object that is the core of AJAX. XMLHttpRequest was introduced in 2000, mainly to enable Microsoft Outlook Web Access to display e-mails without notification. Since then, AJAX applications have gained popularity for their ability to asynchronously exchange data with a server and then display that data without having to reload the Web page on which the data appears.” [from MSDN]

The XMLHttpRequest object establishes the communication between the browser and the server over HTTP. As the video below illustrates, it is possible to setup multiple simultaneous requests bringing about a huge improvement in user experience.

In a serious Ajax based web application, you will probably be using an established javascript library, such as jQuery, which will abstract the use of the XMLHttpRequest object in efficient cross browser capable methods.

In this, and in subsequent posts, we will examine the nitty gritty of the XMLHttpRequest object.

You can read this article online here.

Code download:
You can download the example code here. This code helps you to test out the XMLHttpRequest object in an asynchronous mode. The article has details on how to set up the application.

Download the full video here [XMLHttpExample_FullVideo.rar, 384 KB] or here [XMLHttpExample_FullVideo.zip, 4.4 MB].