What is Ajax?

From past some years we have been hearing about this Ajax technology which have changed the course of web browsing and have thinner the line between web-based application and desktop-based. So what is this Ajax - simply we can describe it as an approach to web interaction; this approach involves transmitting only a small amount of information to and from the server in order to give the user the most responsive experience possible.

The traditional web application model used to initiate requests to, and process requests from, the web server, the Ajax model provides an intermediate layer - an Ajax engine (thats what Garrett calls) - to handle this communication. An Ajax engine is really just a JavaScript object or function that is called whenever information needs to be requested from the server. Instead of the traditional model of providing a link to another resource (such as another web page), each link makes a call to the Ajax engine, which schedules and executes the request. The request is done asynchronously, meaning that code execution doesn’t wait for a response before continuing. The server — which traditionally would serve up HTML, images, CSS, or JavaScript - is configured to return data that the Ajax engine can use. This data can be plain text, XML, or any other data format that you may need. The only requirement is that the Ajax engine can understand and interpret the data.

When the Ajax engine receives the server response, it goes into action, often parsing the data and making several changes to the user interface based on the information it was provided. Because this process involves transferring less information than the traditional web application model, user interface updates are faster, and the user is able to do his or her work more quickly.

The difference between traditional and Ajax based web application models is shown below:

Difference between traditional and Ajax based web-application model

Main technologies that are behind Ajax solutions are: HTML/XHTML, DOM, and JavaScript. XHTML is obviously necessary for the display of information, while the DOM is necessary to change portions of an XHTML page without reloading it. The last part, JavaScript, is necessary to initiate the client-server communication and manipulate the DOM to update the web page.

We also do require server-side processing since there is no Ajax without a stable, responsive server waiting to send content to the engine. For this purpose you can use the application server of our own choice. Whether we choose to write your server-side components as PHP pages, Java servlets, or .NET components, we only need to ensure that the correct data format is being sent back to the Ajax engine.

Nowadays, many commercial and non-commercial websites are using Ajax to improve their user experiences. Example of such sites are: Gmail, Google Suggest,Google Maps, Flickr, A9.com, etc.

1 Comment

  1. subesh wrote
    at 6:10 am - 25th June 2008 Permalink

    Good information ………. i liked it…

Post a Comment

Your email is never published nor shared. Required fields are marked *