Created
May 14, 2018 05:57
-
-
Save bozhink/efe9f83b0851787faedaf68b4478c5f7 to your computer and use it in GitHub Desktop.
Disable back button with JavaScript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// See https://codepen.io/dhavalt10/pen/rGLBzB | |
history.pushState(null, null, location.href); | |
window.onpopstate = function () { | |
history.go(1); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment