Here are my favorite tips to land the software engineer interview.
What are some ways to do this that are supported across browsers?
false will serve the page from cache. If we set it
true, then we’ll reload an entirely fresh copy of the page from the server (similar to a force refresh).
If we are refreshing after an
onclick event, we’ll need to
return false afterwards.
window.location.reload(false); return false;
If we want to reload the page after submitting a
method="post" form, then we have two options.
We can keep the
POST data using the same solution as above.
Or we can discard the
window.location.href = window.location.href;