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