Removing hash from URL

后端 未结 5 867
忘了有多久
忘了有多久 2021-01-01 05:09

After removing hash from URL using window.location.hash=\'\' page getting reloaded in firefox.

EDIT

Example:

wwww

5条回答
  •  一向
    一向 (楼主)
    2021-01-01 05:43

    Just in case somebody else is still looking for a solution to this. Try this when the page loads.

    history.pushState("", document.title, window.location.pathname);
    

提交回复
热议问题