-
-
Save jj1bdx/ab6ffaeb3f6524501f07 to your computer and use it in GitHub Desktop.
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
<!DOCTYPE html> | |
<title>localStorage test</title> | |
<body> | |
<h1>localStorage test</h1> | |
<script> | |
if ( ! window.console ) { | |
console = { | |
log : function( s ) { | |
alert( s ); | |
} | |
} | |
} | |
var isEnabledLocalStorage = false; | |
try { | |
if ( !window.localStorage ) { | |
console.log( 'window.localStorage property does not exist.' ); | |
} else { | |
console.log( 'window.localStorage propety exists.' ); | |
isEnabledLocalStorage = true; | |
if ( window.localStorage === null ) { | |
console.log( 'window.localStorage is null.' ); | |
isEnabledLocalStorage = false; | |
} | |
} | |
} catch (e) { | |
console.log( 'window.localStorage propety causes exception.' ); | |
} | |
console.log( isEnabledLocalStorage ); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment