O'Reilly logo

JavaScript & jQuery: The Missing Manual, 3rd Edition by David Sawyer McFarland

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 13. Introducing Ajax

JavaScript is great, but it can’t do everything. If you want to display information from a database, dash off an email with results from a form, or just download additional HTML, you need to communicate with a web server. For these tasks, you usually need to load a new web page. For example, when you search a database for information, you usually leave the search page and go to another page of results.

Of course, waiting for new pages to load takes time. If anything, people want websites to feel faster and more responsive, as if they were operating right on their own desktop, not on some far-off server. Sites like Facebook, Twitter, Google Docs, and Gmail are blurring the line between websites and desktop computer programs. The technology that makes this new generation of web applications possible is a programming technology called Ajax.

Ajax lets a web page ask for and receive a response from a web server and then update itself without ever having to load a new web page. The result is a website that feels more responsive. For example, when you visit Google Maps (Figure 13-1), you can zoom into the map; move north, south, east, or west; and even grab the map and drag it around. All of these actions happen without ever loading a new web page.

What Is Ajax?

The term Ajax was originally coined in 2005 to capture the essence of new websites coming from Google—Google Maps (http://maps.google.com), and Gmail (www.gmail.com). Ajax stands for Asynchronous JavaScript ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required