INTRODUCTION TO AJAX
AJAX COMPARED TO CLUNKY WEB INTERFACES
The classic web application model works like this: Most user actions in the interface trigger an HTTP request back to a web server. The server does some processing — retrieving data, talking to various legacy systems — and then returns an HTML page to the client.
This approach makes a lot of technical sense, but it doesn’t make for a great user experience. While the server is doing its thing, what’s the user doing? That’s right, waiting. And at every step in a task, the user waits some more.
An Ajax application eliminates the start-stop-start-stop nature of interaction on the Web by introducing an intermediary — an Ajax engine — between the user and the server. It seems like adding a layer to the application would make it less responsive, but the opposite is true.
When you write an application today, you have two basic choices:
Desktop applications are usually pretty fast (they're running on your computer; you're not waiting on an Internet connection), have great user interfaces (usually interacting with your operating system), and are incredibly dynamic. You can click, point, type, pull up menus and sub-menus, and cruise around, with almost no waiting around.
On the other hand, Web applications are usually up-to-the-second current and they provide services you could never get on your desktop (think about Amazon.com and eBay). However, with the power of the Web comes waiting -- waiting for a server to respond, waiting for a screen to refresh, and waiting for a request to come back and generate a new page.
Ajax attempts to bridge the gap between the functionality and interactivity of a desktop application and the always-updated Web application. You can use dynamic user interfaces and fancier controls like you'd find on a desktop application, but it's available to you on a Web application.
TECHNOLOGIES INVOLVED IN AJAX
CSS offers a way of defining reusable visual styles for web page elements. HTML is used to build Web forms and identify fields for use in the rest of your application.
XMLHttpRequest object is the heart of AJAX. It allows web programmers to retrieve data from the web server as a background activity. The data format is typically XML but it works well with any text-based data.