AJAX - The Complete Reference

(avery) #1

PART II


Chapter 9: Site and Application Architecture with Ajax 467


Applied History


As a demonstration of the history mechanism in action, we have modified the photo viewer
application to work with the back button. This particular application is quite interesting to
present because it moves between using XHRs for populating the list of pictures and also
uses standard image tags to fetch the thumbnails and full pictures. We need to provide
history support for both activities to provide a seamless experience for the end user.
Rather than walk through just the code, we present a walk-through of some use cases
with code flow explanations. Upon entry to the application, the page is set up with
categories and the history system initializes, but it does not add a history entry since we are

FIGURE 9-11 Hello and Hello Again
Free download pdf