0 оценок0% нашли этот документ полезным (0 голосов)
14 просмотров1 страница
The document discusses disabling the back button on a webpage. It mentions uploading a JavaScript file called back.html that can disable the back function. It then provides an alternative code snippet using history.pushState and window events to prevent back button navigation and always load the pagename. The body tag calls a noBack function on page load and page show to perform this redirection.
The document discusses disabling the back button on a webpage. It mentions uploading a JavaScript file called back.html that can disable the back function. It then provides an alternative code snippet using history.pushState and window events to prevent back button navigation and always load the pagename. The body tag calls a noBack function on page load and page show to perform this redirection.
The document discusses disabling the back button on a webpage. It mentions uploading a JavaScript file called back.html that can disable the back function. It then provides an alternative code snippet using history.pushState and window events to prevent back button navigation and always load the pagename. The body tag calls a noBack function on page load and page show to perform this redirection.
have uploaded the file named back.html (javascript file) for the disabling of the back function. If this code not worked the other code is <script type = "text/javascript" > history.pushState(null, null, 'pagename'); window.addEventListener('popstate', function(event) { history.pushState(null, null, 'pagename'); }); </script> <SCRIPT type="text/javascript"> window.history.forward(); function noBack() { window.history.forward(); } </SCRIPT> </HEAD> <BODY onload="noBack();" onpageshow="if (event.persisted) noBack();" onunload="">