Yorkshire image

The Basics

Ajax (see www.riaspot.com/articles/entry/What-is-Ajax-) basically exploits an object found in most browsers called XMLHttpRequest (a.k.a. XHR), which allows the browser to carry out an HTTP request to the server without refreshing the page. Using

Now, when the data is taken as it is received from the server and plunked into a DOM element (using innerHTML read/write DOM element access, again, supported by major browsers), that is called AHAH: Asynchronous HTML and HTTP. The main thing is that the response from the server cannot be XML or anything other than pure text or valid XHTML or HTML. This sounds simple but is not so simple, because it involves multiple processes running on multiple hosts in constant communication. This book has already discussed the serving of static and dynamic pages, and understood them. Figure 12-1 shows this in the context of the serving of a static HTML page from the filesystem in the server.