开发者

Problem with IE Hash back button

开发者 https://www.devze.com 2023-02-02 04:08 出处:网络
I have an issue with ajax loading pages and the back button. I k开发者_如何学编程eep track of changes by modify the hash value. On firefox, I can get the back button to work perfectly by interval chec

I have an issue with ajax loading pages and the back button. I k开发者_如何学编程eep track of changes by modify the hash value. On firefox, I can get the back button to work perfectly by interval checking in javascript for the hash to see if it changes. On IE, I'm running into a problem where IE is not even keeping it in the history.

For example,

I have page:

a.html#a

Then I click:

a.html#b

Now when I press the back button, I'd expect it to go to a.html#a, but instead it goes back to the page before that. It doesn't matter how deep I get, it always go to the page prior to a.html#a.

What gives? I read some solutions and it appears I should load a hidden iframe somewhere on the page, but even that doesn't work. The pages in a.html are ajax loaded into a container on the page. Switching to iframe is not an option for me at this point.

Please help.


I had a similar problem some weeks ago. See this SO issues: my question, and a similar which helped me out.

I am using the jQuery history plugin to handle that problem.

If you have problems implementing it, i can help you. but it was very easy.

0

精彩评论

暂无评论...
验证码 换一张
取 消