How do I redirect to another webpage?

Created by Ryan McGearyLinked to 96m issues across 213 teams

tl;dr

To redirect to another webpage using Javascript, you should use the window.location.replace(...) method.

To use window.location.replace(...), you can use the following syntax:

window.location.replace("http://example.com");

This will simulate an HTTP redirect.