If you want to simulate someone clicking on a link, use location.href.
If you want to simulate an HTTP redirect, use location.replace.
For example:
// similar behavior as an HTTP redirect
window.location.replace("http://newpage.com");
// similar behavior as clicking on a link
window.location.href = "http://newpage.com";
Bye
If you want to simulate an HTTP redirect, use location.replace.
For example:
// similar behavior as an HTTP redirect
window.location.replace("http://newpage.com");
// similar behavior as clicking on a link
window.location.href = "http://newpage.com";
Bye
Nessun commento:
Posta un commento