javascript - Expiring a page when back button is clicked -
i have page searches flight. if user has clicked button in browser, should display error message. tried following code: -
function preventback(){window.history.forward();} settimeout("preventback()", 0); window.onunload=function(){null}; problem is not redirecting page saying "this document has been expired."
you can not detect if user has clicked "back" button natively. reason
this document has been expired
is send new form again , againt on previous page. great flaw in architecture.
however if still insist on approach, you can use this plugin. redirect error page, when back-click detects. (like window.location = '/path/to/error/page.html')
Comments
Post a Comment