I have a web application which requires to control browser back button. i.e., when user clicks on browser back button user should redirect to the predefined url in same window tab and not the previous link from where user came to the current page. I am successfully able to detect IE8 browser back button but fails to redirect user to the predefined link. I have written the below code but its not working for IE8.
window.open('targeURL', '_self');
Here is the Code snippet
window.onbeforeunload = function(e) {
if(window.event)
{
if(window.event.clientX < 40 && window.event.clientY < 0)
{
window.open("https://www.google.com/","_self");
}
}
}
Please Help out.