How to make the browser back button disregard hash tags?

后端 未结 5 2254
温柔的废话
温柔的废话 2021-02-14 07:57

I have a website that uses hashes to open/close some tabs and layers on the current page. The reason behind using hashes is, that if a user visits another page via a link and th

5条回答
  •  死守一世寂寞
    2021-02-14 08:47

    You can count how many hashes you've clicked since you've loaded the page, then use that count with history.go( - countHashes) to go back to your page.

提交回复
热议问题