Skip to content

Instantly share code, notes, and snippets.

@glynrob
Created January 6, 2013 12:51
Show Gist options
  • Select an option

  • Save glynrob/4466924 to your computer and use it in GitHub Desktop.

Select an option

Save glynrob/4466924 to your computer and use it in GitHub Desktop.
List Webapp save data with Web storage
// 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