Posted By

FatFolderDesigner on 08/14/11


Tagged

javascript jquery html5


Versions (?)

Local Storage in HTML5


 / Published in: JavaScript
 

URL: http://fatfolderdesign.com/295/html5/making-offline-sitesapplications

This is just a simple explanation of how to use the HTML5 local storage in javascript. The link has a more thorough explanation and an example for those interested. The examples to save, retrive, and clear are marked below.

  1. //Store "something" to the local storage under the name "stored_item".
  2. localStorage["something"]="stored_item";
  3.  
  4. // Get "item" from the localStorage item "something";
  5. var stored_item = localStorage["something"];
  6.  
  7. // Clear the local storage variable "something"
  8. localStorage.removeItem("something")

Report this snippet  

You need to login to post a comment.