javascript location.hash refreshing in IE

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

    If you use javascript to set the hash don't use a "#"

    window.location.hash = '#foo'; //IE will reload the page
    window.location.hash = 'foo'; //IE will set the hash but will not reload the page
    

提交回复
热议问题