Sunday, February 2, 2020

Disable the browser back button

Use this script to disable the browser back button once the user has logged out. So that even if he tries to click the back button and go back to the previous page he will not be able to go.



<script>
    history.pushState(null, null, location.href);
    window.onpopstate = function () {
        history.go(1);
    };
</script>

1 comment:


  1. This concept is a good way to enhance the knowledge.thanks for sharing.. Great article ...Thanks for your great information, the contents are quiet interesting.
    Django Online Courses
    Django Training in Hyderabad
    Python Django Online Training
    Python Django Training in Hyderabad

    ReplyDelete

Git Commands

Git Version   To check the git version Git -v       Git Clone To clone the repository, use the following command: Git clone [u...