Back button activated deep anchoring in IE
This is the issue that SWFAddress fixed. But, essentially, I would like to write my own solution that cuts out a lot of unused features. Explanation below:
You can use the following code to get the hash value of the url link like this xxx.xxx.com/? # / DeepLinking /
window.location.hash
Using anchor tags with href='#tab1
... etc. and Javascript, you can do the deep linking work. Whenever the hash changes, I can serve up the custom content.
The problem occurs when using the Back button and window.location.hash
. In browsers other than IE, if you use the back button to revert to the previous state of the hash symbol window.location.hash
will return the correct value. In IE, it doesn't return the current hash value, but the one that was clicked before the back button was clicked.
I've seen a fix for Iframe, but I'm not sure exactly how it works? Please provide a comprehensive agnostic solution. Thanks!
a source to share
I would look at YUI 2: Browser History Manager . Check out his sources to see how they did it.
EDIT: or have a look at history.js from Google Closure Library.
a source to share
Ditch History.js http://github.com/browserstate/history.js is framework agnostic and is for the new HTML5 history API that allows you to change the url directly, so you don't pose hash problems .
a source to share