Javascript: How to truly reload a site with an anchor tag?
After you set the specified URL into location, issue window.location.reload(true)
. This will force browser to reload the page.
use the query part of the URL to add a random string:
// Use a timestamp to make sure the page is always reloaded
window.location.href = 'mysite.htm?r='+(+new Date())+'#images';