Saturday, August 2, 2008

What is AJAX?

AJAX stands for Asynchronous JavaScript And XML. It got famous through Gmail etc. It is a part of Web 2.0 Techniques which allows some part or the whole document to dynamically update without refreshing the whole web page. So the time taken to get the response from the server gets reduced as the pages are getting updated in the background through AJAX. Also it gives more interaction on the web page. It is a browser based technology and is independent of any Web Server Programming language.

AJAX Acronym:
A:
‘A’ stands for Asynchronous mode. This technique allows the web page to make request in asynchronous/synchronous mode to the web server. By default in all the AJAX examples it is set to Asynchronous mode. The advantage of making it asynchronous is that is will allow the web page to make multiple calls at a same time which will work in the background and will update the page dynamically as soon the request gets over.

J:
‘J’ stands for JavaScript. AJAX extensively rely on JavaScript Engine for its functioning. So it is essential that the JavaScript should be enabled for AJAX to work.

X:
‘X’ stands for XML. AJAX uses the XMLHttpRequest Object of the JavaScript Engine. With this object it can also handle the request and response messages in XML Format apart fron traditional text format.

Examples of AJAX based websites:
www.gmail.com

Limitations of AJAX:

  • It can only access the page from the domain the original web page is coming from. i.e. demo.html residing at example.com can makes AJAX call to web page residing only at www.example.com.

Headache of AJAX Programming:

  • All the program will have to be written in JavaScript. So you must be an expert in JavaScript to write AJAX Programs.
  • AJAX program should be compatible with different browsers DOM.
  • Lot of request goes to the server. So the server requires huge bandwidth to allocate the request made.
  • Testing on different browsers.
  • Sometimes if your servers fails to respond to the AJAX call then you will have to wait endlessly until you again make the AJAX call.

Before AJAX came into Picture:

  • IFRAME were used to display data of other webpage or other domain in the same page. The page inside the IFRAME can be reload/changed dynamically using Traditional JavaScript Technique.

Ready for going deep into AJAX Programming, if yes than check out the links below.

Bookmark It

No comments: