-1

When I press on the hash button(e.g : http://test/#userid=1), I get the requested page but I can not return to previous page via the browser's back button. In Mozilla Firefox 5, the back button works, but not in others browsers.

I want javascript code or jquery code (Code not plugin if possible) to make the back button work in major browsers.

George Cummins
  • 28,485
  • 8
  • 71
  • 90
David coder
  • 17
  • 1
  • 4
  • The back button not working with hash locations is news to me; which is a specific browser that's not properly implementing the back button? I just tested in Firefox, Chrome, and IE. – Jacob Aug 17 '11 at 00:08
  • I see... in IE 9, if you started with no hash and go to `#userid=1`, the back button brings you back to the no-hash version, but if you start with no hash, go to `#userid=1`, then to `#userid=2`, the back button will take you back to the no hash URL, not `#userid=1`. – Jacob Aug 17 '11 at 00:15
  • Jacob : I did not understand well, please explain again – David coder Aug 17 '11 at 00:23
  • http://www.asual.com/jquery/address/samples/crawling/ visit this link, it's work in all browsers can you give the way in which the page (http://www.asual.com/jquery/address/samples/crawling/) runs ??? – David coder Aug 17 '11 at 00:25
  • possible duplicate of [Problem with IE Hash back button](http://stackoverflow.com/questions/4596769/problem-with-ie-hash-back-button) – Jacob Aug 17 '11 at 00:34

1 Answers1

0

The jQuery history plugin reports that it can solve the problem you're having. It appears to use an iframe hack for properly preserving the history in IE.

Jacob
  • 77,566
  • 24
  • 149
  • 228
  • Look at the notes for IE 6 & 7 in this SO answer: http://stackoverflow.com/questions/1078501/keeping-history-of-hash-anchor-changes-in-javascript/1091829#1091829. The same technique is what the plugin uses. – Jacob Aug 17 '11 at 00:36