jQuery is not required. Use window.location.replace(...) to make it simple. This is better than using window.location.href. Because replace() does not put the original page in the session history, it does not fall into an infinite orbit when the user presses Back. However, if you want to connect by clicking on the link, you should use location.href. If you want to replace an existing page with a new page, you can use location.replace.
// HTTP redirect
window.location.replace("http://stackoverflow.com");
// Link connection
window.location.href = "http://stackoverflow.com";
© 2024 OneMinuteCode. All rights reserved.