Javascript examples for Browser Object Model:History
Close modal on browser back and then erase the forward state
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){/* w w w. j a va 2 s .c om*/ history.pushState(null, null, 'no-back-button'); window.addEventListener('popstate', function(event) { history.pushState(null, null, 'no-back-button'); }); } </script> </head> <body> </body> </html>