I have a page that searches for flight. If user has clicked the back button in the browser, it should display an error message. I tried the following code: -
function preventBack(){window.history.forward();}
setTimeout("preventBack()", 0);
window.onunload=function(){null};
Problem is that it is not redirecting to a page saying "This document has been expired."