So where did the term “Ajax” come from, exactly? Take a look at Figure 1.5, which shows the very important first article written on Ajax, the article that coined the term and started everything. You can find that article at www.adaptivepath.com/publications/essays/archives/000385.php.This article is by Adaptive Path’s Jesse James Garrett, who was the first to call this technology Ajax.
Figure 1.5: The original Ajax article
Here’s how that article starts:
“If anything about current interaction design can be called ‘glamorous,’ it’s creating Web applications. After all, when was the last time you heard someone rave about the interaction design of a product that wasn’t on the Web? (Okay, besides the iPod.) All the cool, innovative new projects are online.
“Despite this, Web interaction designers can’t help but feel a little envious of our colleagues who create desktop software. Desktop applications have a richness and responsiveness that has seemed out of reach on the Web. The same simplicity that enabled the Web’s rapid proliferation also creates a gap between the experiences we can provide and the experiences users can get from a desktop application.
“That gap is closing.”
The “asynchronous” part means that the browser isn’t going to wait for data to be returned from the server, but can handle that data as it’s sent back, when it’s sent back. In other words, data transfers take place behind the scenes, without making the browser pause and wait for something to happen. That’s a crucial part of Ajax: You can handle data from the server when the server sends you that data. You don’t have to put your whole application on hold until that data arrives. If you had to wait for that data, your application would be synchronous; and with slow Internet connections, that could be a problem.
What about the XML part of the term Ajax? As you probably know, XML has become the lingua franca of the Web, providing a text-based way to send data back and forth across the Internet. The reason XML has become so popular is that it is indeed text-based, which means that you can sling XML around the Internet, because the Internet was designed to handle text-based documents (that is, HTML). For that reason, Ajax applications are often written to handle data sent back from the server using XML. In other words, when you contact the server, it’ll send data back to you as an XML document.
In fact, XML is only one of the ways to handle data sent to you from the server. You can also send back plain text as well, and you’re going to see both techniques extensively in this book.
Actually, the technology for Ajax has been around since 1998, and had already been used by a number of applications such as Microsoft’s Outlook Web Access. But it didn’t really catch on until early 2005 when some high-profile applications such as Google Suggest put it to work, and Jesse James Garrett wrote his article coining the term Ajax, which put everything under one roof.
Since that time, things have exploded as developers have realized that Web software can finally start acting and behaving like desktop software. So what can you do with Ajax? That’s what the rest of this chapter is about.