Search code examples
javascriptbrowser-history

What are the standard techniques/libraries for back button/linking support in heavily Ajax pages?


I am just coming back to web development after a while away and am now building heavily Ajax-ified pages to the point of doing loading/hiding of whole sections of the site with javascript and am horrified how this tends to lead to sites that are incompatible with bookmarks and the browser's back-button. In the absence of a unified back-button API I'm sure various techniques, do's and don'ts and probably javascript libraries exist to deal with the issue.

What are the various techniques available? I know of one involving a timer and hashlinks? What are your recommendations?

and who if any are the heavy-hitter libraries to be looking at,


Solution

  • just look for the term "hash-bang" ...

    you'll find sth like:

    and, just for info, there is PushState API (which is supported by modern browsers only!) (gitHub is using this for navigating through a source-tree)