Asynchronous JavaScript And XML [AJAX]

AJAX is a new technique for creating faster, better, and more interactive web applications with the help of XML, HTML, CSS, and Java Script.

Ajax uses XHTML for content, CSS for presentation, along with Document Object Model and JavaScript for dynamic content display

How an AJAX Works

An Client side user performs action to generate event that an event calls to a JavaScript function.
A JavaScript function create XMLHttpRequest object,XMLHttpRequest object specify an JavaScript callback function.
A JavaScript XMLHttpRequest object call as an asynchronous HTTP request to a server.
A Web Server Process each request and return XML.
XMLHttpRequest object calls to each a callback function along with a response from a web server.

JavaScript

AJAX doesnot work independently.AJAX is mainly used in combination with all other technologies to create an interactive webPages.

Action

An XMLHttpRequest object has been created. The XMLHttpRequest object makes an asynchronous request to all the webserver. BuildParam(paramObj). ParseParam(paramString). jsonp(opts).

Browser Support

All available browsers cannot support AJAX.Here is a list of all Major browsers that support AJAX. Mozilla FireFox 1.0 and above. Netscape Version 7.1 and above. Apple Safari 1.2 and above. Opera 7.6 and above.

Advantages

AJAX Reduces a server traffic in both side request.Also reduces a time consuming on both side response. AJAX is a much responsive whole pages data transfer at a time.

AJAX Request

XMLHttpRequest Object

.    Define XMLHttpRequest.
.    Set Callback Function.
.    Open() method.
.    send() method.
.    Set Callback Function.
.    responseText / XML / Body.

XMLHttpRequest Methods

XMLHttpRequest Object

.    SetRequestHeader().
.    abort().
.    getResponseHeader().
.    getAllResponseHeaders().
.    Set Callback Function.
.    getAllResponseHeaders().