Last active
April 28, 2016 09:04
-
-
Save yasirtaher/b542af375438e3acf5a673cdeb70e835 to your computer and use it in GitHub Desktop.
prevent a browser from going back in history
This file contains 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
//prevent to go back | |
history.pushState(null, null, location.href); | |
window.onpopstate = function(event) { | |
history.go(1); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment