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