Chapter 3. Simplifying Ajax with Prototype
This chapter covers
- Redesigning QuickGallery for Ajax
- Using XML and Ajax
- Using JSON and Ajax
At the heart of Ajax is the ability to make asynchronous requests to the server, and thereby separate communications from the user interface. The impact of this on usability can’t be overstated. It allows the user to get on with the job while the web app gets on with its own housekeeping duties, without the two coming into conflict. Increasing usability not only makes the current round of web apps easier to use, it extends the reach of the web app to far more demanding usage scenarios, right up to the mission-critical apps that are used intensively, day-in, day-out.
In chapter 1, we saw how complicated dealing with the XMLHttpRequest object could be, and we offered a sneak preview of how Prototype’s Ajax helper classes could make it that much easier to work with. In this chapter, we’ll unpack Prototype’s support for Ajax more comprehensively, and examine the full range of options that it offers. (This and the next chapter deal with Prototype. We’ll start to work with Scriptaculous in chapter 5.) Once you’ve mastered the contents of this chapter, you’ll not only be able to improve the usability of your apps by an order of magnitude, you’ll get to stay sane and go home on time.