how to redirect to a page using javascript code example Example: redirect with javascript window.location.replace('http://mywebsite.com/home.html');