Force page reload with html anchors (#) - HTML & JS
问题 Say I'm on a page called /example#myanchor1 where myanchor is an anchor in the page. I'd like to link to /example#myanchor2 , but force the page to reload while doing so. The reason is that I run js to detect the anchor from the url at the page load. The problem (normally expected behavior) here though, is that the browser just sends me to that specific anchor on the page without reloading the page. How would I go about doing so? JS is OK. 回答1: I would suggest monitoring the anchor in the URL