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 :: authfunctions react 
Javascript :: how to get the height of window in javascript 
Javascript :: vertical align center react native view 
Javascript :: remove yellow warning react native emulator 
Javascript :: javascript change meta tag 
Javascript :: unsplash api javascript example 
Javascript :: reduce decimals to 4 digits javascript 
Javascript :: javascript replace space by underscore 
Javascript :: document ready javascript vanilla 
Javascript :: javascript detect internet explorer 
Javascript :: how to know connected internet in js 
Javascript :: addclass js vanilla 
Javascript :: react js installation 
Javascript :: jquery check if div has a certain style 
Javascript :: add url query in js 
Javascript :: UnhandledPromiseRejectionWarning: MongoParseError: URI does not have hostname, domain name and tld 
Javascript :: remove previous datatable instance 
Javascript :: random number javascript 
Javascript :: data structures for coding interviews in javascript 
Javascript :: jquery prevent event bubbling 
Javascript :: how to select html body in javascript 
Javascript :: react native flatlist margin bottom 
Javascript :: python print pretty json 
Javascript :: generate otp using javascript 
Javascript :: react native seperator code 
Javascript :: Get First Day and last day of week javascript 
Javascript :: node wait 10 seconds 
Javascript :: show password on click button jquery 
Javascript :: add bootstrap to react,.........,,,, 
Javascript :: vue get window width 
ADD CONTENT
Topic
Content
Source link
Name
9+1 =