AJAX - The Complete Reference

(avery) #1

PART II


Chapter 9: Site and Application Architecture with Ajax 465


saved or not, either a request is rerun with the saved request options, or the retrieved
response data is used as if it were cached. In the case that history was manually set, the
primary callback defined via init() is invoked.

NNOT EOTE The HTML 5 specification from the WhatWG group is showing the possibility of extending
JavaScript history objects to support pushState() and clearState() methods that will perform
similar functions to what we do here, so you can be confident that the approach taken here is not
far from the mark, despite its ugly iframe, hackish nature.

If you didn’t fall asleep or go insane from reading this discussion, we provide in
Figure 9-10 a high-level view of how the history mechanism works, though the diagram
may only be a tad better than the textual description.
However, the third and most important point is the application of this hard work.
The library hides lots of detail and should make building a URL-sound Ajax application

FIGURE 9-10 AjaxTCR history mechanism for Ajax uncovered
Free download pdf