Search This Blog

Tuesday 5 August 2014

How to disable Browser back / forward buttons using java script?

    <script type="text/JavaScript">
      <%-- Browser Back Button Disable--%>
        function disableBackButton() {
            window.history.forward();// this line is enough
        }
        setTimeout("preventBack()", 0);
        window.onunload = function () { null };
    </script>

 <%-- Browser Forward Button Disable--%>

        window.history.forward(1);

No comments:

Post a Comment