I have some bad news: There really isn't an Ajax. Like DHTML, Ajax is not a single technology created to fill the needs of the Web design community, but a collection of existing technologies that was given a cool sounding acronym to better categorize them.
You may remember me telling you in Part 2 of this book that there isn't a DHTML (see Chapter 11). Now, in this chapter, I'm telling you there isn't an Ajax. You're probably saying, "The Web sure seems to be based on a lot of non-existent technologies." But this is the glory of the Web. It evolves not just from recognized standards, but in a way that anyone can combine and mutate those standards to create unexpected results.
DHTML and Ajax, on the other hand, have evolved synergistically out of existing technologies without an exact purpose in mind. This development happened more or less organically within the Web development community over several years. The term used to describe these technologies was coined only after someone recognized a common thread maturing.
The story behind Ajax is that renowned Web designer and pundit Jesse James Garrett coined the term in 2005 while he was in the shower. Jesse needed a catchy idiom to describe the suite of technologies he was getting ready to propose using to a client (Figure 19.2). By the time he had toweled off, Ajax was born.
Figure 19.2. The original article coining the term Ajax, written by Jesse James Garrett.
So, why "Ajax"? Here's the break down:
Developers have been steadily moving towards using this combination of technologies for several years. Many Web designers recognized the need to move beyond the Web page metaphor and think of a Web page as an application through which the Web site visitor interacted with data. Many solutions, mostly involving frames, have been tried, but none has ever proven completely satisfactory.
Ajax brings together a number of different Web technologies that, when used together, let designers take dynamic Web pages much further by enabling visitors to interact with the entire Web through a single Web page interface.
Let's take a closer look at what's involved (Figure 19.3).
Figure 19.3. The components of Ajax.
Dynamic HTML (DHTML)
All Ajax solutions require a method for passing data between the Web page in the client (the visitor's browser) and the files on the server used to create the Web page.
One early attempt to allow this type of back and forth communication between the client and the server was through iframes. Often invisible, these "windows to the server" could be used to pass data back and forth.
The original XMLHttpRequest objector a semblance thereofwas created by Microsoft to be used with Outlook as an ActiveX object. Called XMLHTTP, it has been part of the Windows version of Internet Explorer since version 5. Other browsers, including Firefox 1.0, Safari 1.2, and Opera 8.0, support compatible versions of the same type of request object, but with those browsers it is referred to as XMLHttpRequest.
Figure 19.4. Information about the work by the W3C on the XMLHttpRequest object can be found at w3.org/TR/XMLHttpRequest/.
A lot of common APIs (see the sidebar "What is an API?") are also available that let you add Ajax functionality to your Web site without having to create the server-side code yourself. We'll take a look at those in more detail in Chapter 20.