1

I have an issue with ajax loading pages and the back button. I keep 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.

Daniel
  • 11
  • 2
  • 1
    With a little searching, [this SO answer](http://stackoverflow.com/questions/1078501/keeping-history-of-hash-anchor-changes-in-javascript) regarding hashes might be help. Seems to work on IE as well. If nothing else, you can use it as a resource for your problem. – Brad Christie Jan 04 '11 at 18:04

1 Answers1

1

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.

Community
  • 1
  • 1
helle
  • 11,183
  • 9
  • 56
  • 83