ajax programming

How to Create Exciting and Dynamic Web Pages and Applications

Ajax is no longer just a powdered household and industrial cleaner introduced in the 1940s by Colgate-Palmolive, but a new approach to building dynamic web applications. The name is shorthand for Asynchronous JavaScript and XML (Extensible Markup Language), and it represents a fundamental innovation for developing interactive applications on the Web.

Ajax Defined

Ajax is not a single technology but really several technologies combined in powerful new ways. Ajax uses a combination of:
  • HTML and Cascading Style Sheets for designing the appearance of information on a web page.
  • A client-side scripting language, such as JavaScript to dynamically display and interact with the information on the web page.
  • The XMLHttpRequest object to exchange data asynchronously with the web server.
  • XMLHttpRequest is an application programming interface used by JavaScript to transfer text date between a web page’s client side on the local machine and the server side page on the web server.
  • The use of XML to format the data transferred between the server and client.
XMLHttpRequest is an important part of the Ajax web development technique. It is used by many websites, including Google Maps, Mapquest and Facebook, to implement responsive and dynamic web applications.

Advantages of Ajax

In the more classic web application, user actions in the interface trigger an HTTP request back to a web server. The server does some processing — retrieving data, crunching numbers, 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, the user is waiting and at every step in a task, the user waits even more. A web application using Ajax eliminates the waiting and the start-stop-start-stop nature of interaction by introducing an intermediary, an Ajax engine, between the user and the server. Instead of loading a webpage, at the start of the session, the browser loads the Ajax engine usually written in JavaScript and hidden on the web page. This engine is responsible for both providing what the user sees on the screen and communicating with the server on the user’s behalf. The Ajax engine allows the user’s interaction with the application to happen asynchronously, independent of communication with the server. The user no longer needs to wait for the server to respond, so web applications written in Ajax allow for increased response times and an improved and richer experience for the user.

The Future of Ajax

Ajax is at the top of the list of technologies developers will begin using in the next 18 months, according to a survey by Ziff Davis Enterprises. Google is making a huge investment in developing the Ajax approach. All of the major products Google has introduced over the last year are Ajax applications. These projects demonstrate that Ajax is not only technically sound, but also practical for real-world applications. It opens the door to a wider range of richer and more exciting web applications.