Bhakiyalakshmi Selvam
How to disable browser forward and backward button in jquery?
By Bhakiyalakshmi Selvam in JQuery on Jan 30 2017
  • Sourabh Somani
    Feb, 2017 16

    window.history.forward(); function preventBack() { window.history.forward(1); }we can call preventBack() function on page load

    • 1
  • Bidyasagar Mishra
    Aug, 2019 11

    1. <html>
    2. <head>
    3. <title>Disable Browser Back Button Using JavaScript</title>
    4. <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
    5. <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/jquery-ui.min.js">
    6. </script>
    7. </head>
    8. <body>
    9. <a href="Page2.htm">Click Here...</a>
    10. </body>
    11. <script>
    12. $(document).ready(function() {
    13. function disableBack() { window.history.forward() }
    14. window.onload = disableBack();
    15. window.onpageshow = function(evt) { if (evt.persisted) disableBack() }
    16. });
    17. </script>
    18. </html>

    • 0
  • Thennarasu N
    Mar, 2017 17

    please try this http://www.htmlgoodies.com/tutorials/buttons/article.php/3478911/Disabling-the-Back-Button.htm

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS