function redirect javascript code example Example: function redirect javascript window.location.href = "http://mywebsite.com/home.html";