Here’s how to do it properly.
…anywhere in your code to trigger a page reload. It’s that easy.
What about window.location.reload() ?
You may see some use:
If for some reason, you have another variable called location and there is a conflict, you can specify window.location.reload() to get around this.
Reloading from onclick Attribute or Event
You can call for a reload from an HTML elements onclick attribute directly:
<a href="#" onclick="location.reload()">Reload</a>
The location.reload() function doesn’t accept any parameters (it may have in the past in some browsers but is no longer officially supported).
Find out more about it here: