js redirect code
snippet in javascript

js redirect code

user7973

window.location.href = "http://mywebsite.com/home.html";

javascript redirect to url

user2823

// similar behavior as an HTTP redirect
window.location.replace("http://stackoverflow.com");

// similar behavior as clicking on a link
window.location.href = "http://stackoverflow.com";