0

Please have a time to read this post.

So, my web application is appending (/mypage to /mypage#hash) hash programmatically if it saw there's no hash yet, after logging in. In other browsers, even if the page has just appended a hash, when I click on browser's Back button it goes to login page (this behavior is what I wanted - /mypage#hash to /loginpage). But in IE8, after clicking Back button it goes to the same page but without hash (/mypage#hash to /mypage).

Any workaround or thoughts for this?? It's really appreciated. If its not clear enough, ask me. I'll make it clear to you.

Thanksss!!!!

kenicky
  • 431
  • 4
  • 14
  • 2
    What is the code you are using? Even if just providing a JSFiddle it will help? – Jacques Marais Jul 15 '14 at 10:11
  • I don't think JSFiddle will help this because I'm using SpringMVC in this. To make it simple, I want to have the hash already in the url, to make the `Back` button go to the page before it. Thx.. – kenicky Jul 17 '14 at 05:55

2 Answers2

0

You can use:

window.location.hash = 'hash';
Bhojendra Rauniyar
  • 83,432
  • 35
  • 168
  • 231
  • I need to have a hash already in the url. setting a hash programmatically in `document ready` will make the `back redirect to no hash. I need it to not do that. any ideas? thx for the reply... – kenicky Jul 17 '14 at 05:51
0

I'm not sure wether this might help but give it a try:

<head>
    <link rel="prev" title="" href="/loginpage">
<!-- ... -->

There is not much to influence the behaviour of a browser in this case.

You can of course always put up your own back link like

<a href="/loginpage">
Daniel W.
  • 31,164
  • 13
  • 93
  • 151