What Does Ajax Mean?


What Does “Ajax” Mean?

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.

image from book
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.”

That gap is indeed closing, thanks to Ajax. So, according to the article, what does “Ajax” actually stand for? It stands for Asynchronous JavaScript and XML. As you can begin to see from its name, and as you can read in the Jesse James Garrett article, Ajax is really a collection of technologies.

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.

The JavaScript part of the term Ajax is also very important because that’s what makes Ajax happen in the browser. Ajax relies on JavaScript in the browser to connect to the server and to handle the data that the server sends back. All the Ajax applications you will develop in this book use JavaScript to connect to the server behind the scenes, uploading and downloading data. And when your data is downloaded, you can use JavaScript in the browser to handle that data, displaying it or crunching it as appropriate.

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.

Besides JavaScript and XML, Ajax also works with dynamic HTML and Cascading Style Sheets (CSS). Both of these technologies allow you to update the data displayed in a Web page, and, because you don’t redraw the entire Web page with Ajax, but just a part of it, you rely on dynamic HTML and CSS quite a bit; both of them allow you to update specific parts of a Web page. You’re going to see a lot more on dynamic HTML and CSS in this book because they allow you to refresh just part of a Web page, something that is central to Ajax-enabled applications.

The part of JavaScript that makes Ajax possible is the XMLHttpRequest object. This is a special object built into all modern browsers’ version of JavaScript. As you’re going to see, this is what makes it possible to connect to the server and handle data sent back from the server behind the scenes. It’s not just JavaScript that makes Ajax tick, it’s the XMLHttpRequest object inside JavaScript.

So there you have it; Ajax is a collection of technologies, not just a single technology. You use the XMLHttpRequest object built into JavaScript to connect to the server, and then handle the XML-or plain text-the server sends back using JavaScript. And you use dynamic HTML and CSS to display the results in the browser. It’s lucky that all the parts of Ajax applications came together asthey did-JavaScript, the XMLHttpRequest object, dynamic HTML, and CSS-because all together, they make it possible to make your online applications look like desktop applications.

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.



Ajax Bible
Ajax Bible
ISBN: 0470102632
EAN: 2147483647
Year: 2004
Pages: 169

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net