×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Added: May 29, 2014 4:40 PM
Views: 9
Tags: no tags
Almacenamiento de objetos en HTML5 localStorage
  1. var testObject = { 'one': 1, 'two': 2, 'three': 3 };
  2.  
  3. // Put the object into storage
  4. localStorage.setItem('testObject', JSON.stringify(testObject));
  5.  
  6. // Retrieve the object from storage
  7. var retrievedObject = localStorage.getItem('testObject');
  8.  
  9. console.log('retrievedObject: ', JSON.parse(retrievedObject));