How to keep the browser history in sync when using Ajax?

Update: There is now the HTML5 History API (pushState, popState) which deprecates the HTML4 hashchange functionality. History.js provides cross-browser compatibility and an optional hashchange fallback for HTML4 browsers.

The answer for this question will be more or less the same as my answers for these questions:

In summary, you’ll definitely want to check out these two projects which explain the whole hashchange process and adding ajax to the mix:

  • jQuery History (using hashes to manage your pages state and bind to changes to update your page).

  • jQuery Ajaxy (ajax extension for jQuery History, to allow for complete ajax websites while being completely unobtrusive and gracefully degradable).

Leave a Comment