Can you use hash navigation without affecting history?

后端 未结 4 609
旧巷少年郎
旧巷少年郎 2020-12-07 10:12

I\'m afraid it might be impossible but is there a way to change the hash value of a URL without leaving an entry in the browser\'s history and witho

4条回答
  •  不知归路
    2020-12-07 10:43

    You can always create an event listener to catch click events on the hyperlink and in the callback function put e.preventDefault(), that should prevent the browser from inserting it into the history.

提交回复
热议问题