Reputation: 20163
In my javascript code, in some point, i need to refresh the window (user has uploaded new image but in page still can see it)
i am wondering why is
location.href = location.href
not refreshing the window?
Upvotes: 4
Views: 7909
Reputation: 48547
If you are wanting your to redirect your page, use:
window.location = location.href;
Or, if it is a simple case of refreshing the page:
window.location.reload();
Upvotes: 9
Reputation: 76880
if you really really need to refresh the page you should do
location.reload(true)
Upvotes: 2