Our first working application showed how AJAX can be used to make multiple requests to a server without the user ever leaving the currently loaded page. It also gave a fairly realistic picture of the kind of complexity we have to deal with when performing multiple tasks asynchronously. A good example of this complexity was our use of setTimeout to time the XMLHttpRequest requests. This example provided a good opportunity to explore some of the common problems you'll encounter as you develop AJAX apps, such as loss of scope and connection timeouts, and provided practical solutions to help you deal with them.
That's it for this excerpt from Build Your Own AJAX Web Applications[46] -- don't forget, you can download this article in .pdf format [47]. The book has eight chapters in total, and by the end of it, readers will have built numerous fully functioning web apps including an online chess game that multiple players can play in real time -- the book's Table of Contents [48] has the full details.
Summary
In this chapter, we had a quick
overview of AJAX and the technologies that make it tick. We looked at
some of the horrible coding contortions that developers had to endure
back in the bad old days to create something resembling an interactive
UI [25], and we saw how AJAX offers a huge improvement on those
approaches. With a decent command of the building blocks of AJAX --
XML, the DOM, CSS, XMLHttpRequest, and
JavaScript, which ties them all together -- you have everything you
need to start building dynamic and accessible [26] AJAX sites.