window.location.replace(...) will best simulate an HTTP redirect.
window.location.replace(...) is better than using window.location.href, because replace()does not keep the originating page in the session history, meaning the user won't get stuck in a never-ending back-button fiasco.
If we want to simulate someone clicking on a link, use location.href
If we want to simulate an HTTP redirect, use location.replace
This works for every browser:
Wikitechy Rated 5 / 5 based on 378284 reviews.
World's No 1 Animated self learning Website with Informative tutorials explaining the code and the choices behind it all.