Created
October 23, 2018 00:29
-
-
Save tofumatt/1a97169878e232c96870ca422580cee6 to your computer and use it in GitHub Desktop.
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
// Our config values we want to store offline. | |
var config = { | |
fullName: document.getElementById('name').getAttribute('value'), | |
userId: document.getElementById('id').getAttribute('value') | |
}; | |
// Let's save it for the next time we load the app. | |
localStorage.setItem('config', JSON.stringify(config)); | |
// The next time we load the app, we can do: | |
var config = JSON.parse(localStorage.getItem('config')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment