Created
January 9, 2014 19:43
-
-
Save diverted247/8340620 to your computer and use it in GitHub Desktop.
Backspace key from triggering back navigation
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
| document.addEventListener( 'keydown' , function( event ){ | |
| if( event.keyCode == 8 ){ | |
| if( document.activeElement == null || document.activeElement === document.body ){ | |
| event.preventDefault(); | |
| } | |
| } | |
| } , false ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment