Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

Storing Objects in HTML5 localStorage

var testObject = { 'one': 1, 'two': 2, 'three': 3 };

// Put the object into storage
localStorage.setItem('testObject', JSON.stringify(testObject));

// Retrieve the object from storage
var retrievedObject = localStorage.getItem('testObject');

console.log('retrievedObject: ', JSON.parse(retrievedObject));
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript set local storage value 
Javascript :: remove header from certain pages react navigation 
Javascript :: js local storage delete key 
Javascript :: javascript disable right click 
Javascript :: breakline in react native 
Javascript :: prettier ignore line 
Javascript :: set value in span using javascript 
Javascript :: box shadow react native 
Javascript :: ready function jquery 
Javascript :: javascript appendchild image node 
Javascript :: 50 50 chance javascript 
Javascript :: js is empty object 
Javascript :: get last day of month typescript 
Javascript :: vue 3 cdn 
Javascript :: sum of array of objects javascript 
Javascript :: js change html lang 
Javascript :: shorthand for document.ready 
Javascript :: give height to Image in nextjs 
Javascript :: select element by id js 
Javascript :: pass csrf token in ajax laravel 
Javascript :: js start with 
Javascript :: js set date to midnight 
Javascript :: angular pipe capitalize 
Javascript :: remove all html tags from string javascript 
Javascript :: javascript split get last element 
Javascript :: pass header in ajax 
Javascript :: Appium press Enter on android with js 
Javascript :: class onclick jqery 
Javascript :: jquery success refresh page 
Javascript :: generate random password javascript 
ADD CONTENT
Topic
Content
Source link
Name
2+7 =