14
Sep
Learn How to make a redirect page in jQuery/JavaScript?
Here JQuery is not necessary. We can just use JavaScript to do that.
And There are two methods to do that. One is window.location.href = and the other one is window.location.replace(…)
window.location.replace(…) will best simulate an HTTP redirect. If you want to simulate someone clicking on a link, use location.href. If you want to simulate an HTTP redirect, use location.replace.
Here are the examples.
// similar behavior as clicking on a link window.location.href = "http://www.learnhow2do.com";
// similar behavior as an HTTP redirect window.location.replace("http://www.learnhow2do.com");