I like the way facebook changes the URL of the browser address bar when you scroll between images, and how it works on IE7. However, I’ve only found information on how to do it on HTML5 browsers, and I want to support IE7.
As this is a HTML5 solution, the following:
window.history.pushState("object or string", "Title", "/new-url");
is not an option if there’s another solution available.
EDIT
Before any hashes.
But is there?
The only other option I’m aware of involves using the
#hashfragment to determine the “url” or “state” of the page using thehashchangeevent, which is not supported in IE7:http://caniuse.com/#search=hashchange
However, there are polyfills:
http://benalman.com/projects/jquery-hashchange-plugin/
It’s a rather hacky approach and it breaks HTTP protocol since it relies on javascript to output the correct content, but you may not care about that:
http://isolani.co.uk/blog/javascript/BreakingTheWebWithHashBangs
History.jsclaims cross-browser support, although I haven’t used it (uses history for HTML5 browsers, hashchange for older ones):https://github.com/browserstate/History.js/