Reputation: 1083
This works setTimeout(location.reload.bind(location), 2000);
But it loops.
How to do it once?
Upvotes: 0
Views: 46
Reputation: 13151
Perhaps, something like this?
if(!localStorage["reloaded"]) {
localStorage["reloaded"] = "1"
setTimeout(location.reload.bind(location), 2000);
}
You could use a cookie or query string as well.
Upvotes: 2