Ajax is not a technology. In fact, it is several technologies each succeeding in its own field, gathered in a new strong direction. Ajax combines:
Standardized presentation using XHTML and CSS;
dynamic display and interaction using the Document Object Model;
Exchange and manipulation of data using XML and XSLT;
asynchronous data retrieval using XMLHttpRequest;
and JavaScript that ties it all together.
The classic web application model works like this: most user actions send an HTTP request back to the server. The server does the necessary processing – it gets the data, processes the numbers, interacts with various legacy systems, and then outputs the HTML page to the client. This model is borrowed from the original use of the web as a hypertext environment, but those who have read the book know that what makes the web suitable for hypertext does not necessarily make it good for software applications.
This approach makes a lot of technical sense, but it doesn’t achieve good user interaction. While the server is doing its job, what is the user doing? That’s right, waiting. And with every next step, the user waits more and more.
Obviously, if we were building the web from scratch, we would not make users wait all the time. If the page is already loaded, why should the user interaction stop every time the program needs something from the server? In fact, why would the user even want to see the application connect to the server?
What’s the difference between Ajax
An Ajax application eliminates start-stop-stop interaction by introducing Ajax as an intermediate layer between the user and the server. It might seem that adding a new layer to an application only slows down its response, but in fact the opposite is true.
Instead of loading the page at the beginning of the user session, the browser loads the Ajax engine, written in JavaScript and usually hidden in a hidden frame. This engine is responsible for shaping the user interface and interacting with the server on behalf of the user. The Ajax engine allows interaction with the user asynchronously, i.e. independently of the server interaction. So the user no longer has to watch a blank browser window and an hourglass cursor waiting for the server to act.
Every user action that would normally make an HTTP request now instead takes the form of an Ajax JavaScript call. Each response to a user action that doesn’t require a server call, such as a simple data check, in-memory editing, and even some navigation, is handled by the engine itself. If the response requires information from the server, e.g. loading additional interface code, submitting data for processing, or fetching new data, the engine makes the necessary requests asynchronously, usually using XML, without interrupting the user’s interaction with the application.
Who uses Ajax
Google has made a huge investment in developing the Ajax approach. All of the biggest products announced in the last year – Orkut, Gmail, the latest betas of Google Groups, Google Suggest, and Google Maps – are Ajax applications. (For technical details on Ajax implementation, check out the excellent research on Gmail, Google Suggest, and Google Maps.) Others aren’t far behind: many of Flickr’s beloved features rely on Ajax, and Amazon’s A9.com search engines use similar technology.
These projects demonstrate that Ajax works not only in theory, but in practice for real-world applications. This is not just another lab theory. Ajax applications can take on any scale from the simple and single-function Google Suggest to the very complex and intricate Google Maps.
In working with Ajax over the past few months, we at Adaptive Path realized that we had only discovered the tip of the iceberg of the richness of interaction and responsiveness that Ajax applications offer. It’s an important area of web application development right now, and its importance will only grow. And given the large number of developers who already know how to use these technologies, we expect to see more and more organizations follow Google’s lead and take advantage of the competitive benefits that Ajax offers.