javascript location.hash refreshing in IE

后端 未结 9 1233
既然无缘
既然无缘 2020-11-28 06:03

I need to modify the hash, remove it after certain processing takes place so that if the user refreshes they do not cause the process to run again.

This works fine

9条回答
  •  情深已故
    2020-11-28 06:18

    The problem is that "The hash is coming from else where in the web app via a redirect.". If you use javascript to redirect the url in the client like this:

    location.href = 'test1.aspx#testhash'
    

    it will be ok !

    So this is the IE bug: When a web app via a redirect, the browser may only see the prev url, so when you modify the location.hash, the browser sees a url change, so refreshes the page.

提交回复
热议问题