Updated on Kisan Patel
Just add the below code in the head section of the html page.
<script type="text/javascript"> window.onunload=function(){ window.history.forward(); }; </script>
The above JavaScript code uses the history
of the browser and forces it to navigate forward
instead of going to the previous page. Therefore, every time the user clicks the back button or hits the backspace key, it will result in the Browser navigating or pushing the user forward and showing the same page.
Image Credit: laptopmag.com