Force page reload with html anchors (#) - HTML & JS

Posted by yuval on Stack Overflow See other posts from Stack Overflow or by yuval
Published on 2010-04-04T09:03:42Z Indexed on 2010/04/04 9:13 UTC
Read the original article Hit count: 702

Filed under:

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 OK). Thanks!

© Stack Overflow or respective owner

Related posts about html

Related posts about JavaScript