Chapter 9. JavaScript, jQuery, and AJAX

In this chapter, we improve the interactivity of our application using some simple AJAX (Asynchronous JavaScript and XML) support to our application. AJAX allows us to update parts of the screen. Increasing use of AJAX allows web applications to approach the rich flexibility of Desktop applications.

If you look at the Chat screen, you’ll see an area that changes with each screen refresh and an area that stays constant with each screen refresh, as shown in Figure 9-1.

Area to update using AJAX
Figure 9-1. Area to update using AJAX

We will use AJAX to update the outlined area without updating the overall screen.

jQuery

AJAX has been evolving since Microsoft introduced the first form of AJAX (XMLHttpRequest) in 1999. In the early days, AJAX and JavaScript and the browsers’ support for the Document Object Model (DOM) were very much in flux, and it took quite a bit of effort to keep one’s AJAX code working across successive releases of many browsers.

As widely used applications such as Google Mail made increasing use of AJAX, browsers’ support for AJAX improved over time. Also, libraries were produced that shielded the typical developer from cross-browser differences. These two trends together have made the use of AJAX relatively straightforward and something that can be integrated into a wide range of applications to improve the usability of those applications.

One of the more ...

Get Using Google App Engine now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.