Created
January 6, 2013 12:51
-
-
Save glynrob/4466924 to your computer and use it in GitHub Desktop.
List Webapp save data with Web storage
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
| // save the new list locally | |
| function saveLocally(dataToSave){ | |
| var cleanData = JSON.stringify({dataToSave: dataToSave}); // generate clean data | |
| localStorage.setItem("data", cleanData); // save new data locally | |
| showListItems(); // refresh the list display | |
| showLocalData(); // update localdata display | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment