Reputation: 17333
For example, when I am on http://www.example.com/foo
and I use this:
window.location.href = "http://www.example.com/foo#bar";
The default action is that the page doesn't reload, and it just moves me over to the element with id="bar"
.
But what if I explicitly want the page to refresh? How would I do that?
I can use jQuery if necessary.
Thanks.
Upvotes: 1
Views: 47
Reputation: 82251
You can reload the page just after changing the location. Like this:
window.location.href = "http://www.example.com/foo#bar";
location.reload();
Upvotes: 2