window.onload = function() { // similar behavior as an HTTP redirect window.location.replace("http://stackoverflow.com"); }