Link to an anchor AND force reload current page

html, hyperlink

Solution

This worked for me:

<a href="?reload=1#153">Reload</a>

I used a trick. When you use the same address then page won't reload. But when you change address simply by adding fake param "reload=1" then page will be reloaded and navigated to specified anchor.

Btw. reloading with javascript can be tricky or misleading when you want to execute php script again with reload, cos javascript reloads only contents of page but php script is not executed.

Problem

When I click a link with an `href=#` the browser scrolls to the div instead of reloading the page. How can I force a reload? To clarify, I do not want to just reload the page, but I want to reload the page AND go to the associated div designated with the #X. For example `<a href=#153>` should reload the page and go to that div. All current questions in this regards talk about simply reloading the page; not reloading and redirecting to the div. Yes, I am quite aware this is easily done with JavaScript. But with a task so simply, I'm sure there is a way of doing this without JavaScript.

Original source

Related problems