javascript location.hash refreshing in IE

后端 未结 9 1236
既然无缘
既然无缘 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:43

    The similar issue existed in my project. But we could not use methods described above, because when IE refreshed a page, preloaded data was reset. So, we used the feature of the browser. When you click for 'a' tag, onClick event happened firstly and after event browser use 'href' attribute for redirecting. When IE use href with hash for redirecting, reloading do not exist. So, you can use onClick event for invoke server-side processing(__doPostBack for asp.net for example) and when the processing will be executed, browser will use 'href' attribute for redirecting. So, new page will not be reloaded. Also you can use window.location = yourNewLocationWithHash invoking after server-side processing. I hope this help =)

提交回复
热议问题