Created
February 7, 2016 13:08
-
-
Save JBreit/26649ccc5fca9edeb269 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
var Storage = (function (name) { | |
if (supportLocalStorage) { | |
var self = window['localStorage']; | |
if (!localStorage[name]) { | |
localStorage.ApplicationStorage = localStorage[name]; | |
localStorage.ApplicationStorage.users = localStorage.setItem('ApplicationStorage', 'Users'); | |
} | |
console.log(self); | |
document.write(localStorage + '<br>'); | |
document.write(localStorage.ApplicationStorage); | |
} else { | |
console.log('Sorry but your browser does not support window.localStorage.'); | |
} | |
function supportLocalStorage () { | |
try { | |
return 'localStorage' in window && window['localStorage'] !== null; | |
} catch (e) { | |
return false; | |
} | |
} | |
}(Storage || {})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment