AJAX is an acronym that Jesse James Garrett, a user-experience expert who founded www.AdaptivePath.com, coined back in 2005. It quickly morphed into a buzzword who's descriptiveness (and verby-ness) as we'll see, goes way beyond its actual acronym definition. We'll take a quick look at what AJAX really is and how easy it is to implement, not to mention cook up a few more cool solutions for our "hypothetical" clients.
In this chapter, we're going to take a look at:
.load()
function and the more robust .ajax()
functionLet's get started by taking a look at what jQuery does for AJAX.
To start, if you're new to AJAX, I'll just point out that AJAX is actually not a technology or language! The acronym stands for Asynchronous JavaScript and XML. It's the technique of using JavaScript and XML to send and receive data between a web browser and a web server. The most obvious (and cool) use of this technique means you can dynamically update a piece of content on your web page with a call to the server, without forcing the entire page to reload.
The implementation of this technique has made it obvious to many web developers that they can start creating advanced web applications (sometimes called Rich Interface Applications(RIAs)) that work and feel more like desktop software applications, instead of like web pages.
As eluded to above, the word AJAX is starting to have its own meaning (as you'll also note its occasional use in this book and others, as well as all over the web as a proper noun: "Ajax", rather than an all-cap acronym). For example, a web developer using predominately Microsoft technology may develop their site using a browser scripting language called VBScript instead of JavaScript, to sort and display content transformed into a lightweight data format called JSON instead of XML. You guessed it, that developer's site would still be considered an AJAX site, rather than an "AVAJ" site (let's face it, AJAX simply sounds cooler).
In fact, as we noted in Chapter 5, jQuery Animation within WordPress, it's getting to the point where just about anything on a website (that isn't in Flash) that slides, moves, fades, or pops up without rendering a new browser window is considered an "Ajaxy" site. In truth, most of these sites don't truly qualify as using AJAX and if you use just a few of the jQuery examples from this book in your WordPress site, it will probably be considered Ajaxy, despite not calling asynchronously to the server. But after this chapter, it will.