-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IE9 and History.replaceState #55
Comments
Hey mate, Can you provide a step by step set of what is happening - the urls/states that happened step by step, and the urls/states that you expected step by step - that'll really help, thanks :) |
Trying to distill it down to a small reproduce-able test case... but unfortunately right now it's only occurring in my big bulky production code! I'll close this for now and re-open if I can figure out how to reliably reproduce. |
I am having this same issue. Was it ever resolved? |
same issue here |
I'm trying to work out how to do AJAX based page redirects (my endpoint tells the page it needs to redirect through a json object). In order to make it so it behaves like a normal redirect, I need to discard the state from the history so that back button doesn't bring you back onto the redirected page, causing another redirect and effectively killing the back button.
It goes something like this:
This works fine with HTML5 history browsers, but is having trouble with hashchange browsers (IE 9 is the one I've tested with). The back button still triggers the discared state to be hit. I stepped into the code and found that it's because of the way History.js handles the shortened urls to create the state hash. When the state is added to the discarded states, the hash is something like (assuming redirected page was the root url): '/', whereas when the back button is pressed, it compares it to the hash './'... so it doesn't think it's a discarded state.
Any ideas how to fix or work around this?
The text was updated successfully, but these errors were encountered: