how to stop redirect to another page in javascript code example Example: javascript redirect window.location.href = "http://mywebsite.com/home.html";