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 :: emmet not working react js 
Javascript :: p5 map function 
Javascript :: is advanced functions harder than calculus 
Javascript :: javascript prevent context menu 
Javascript :: jquery on body click 
Javascript :: vscode debug ignore node_modules 
Javascript :: access-control-allow-origin nodejs express 
Javascript :: document on click jquery 
Javascript :: copy a file and paste with fs 
Javascript :: js canvas triangle 
Javascript :: input will get only number vue 
Javascript :: js is object empty 
Javascript :: error:03000086:digital envelope routines::initialization error 
Javascript :: how to run a vue js hello world app in vue version 3 
Javascript :: remove previous datatable instance 
Javascript :: javascript get random number in range 
Javascript :: Setting a background Image With React Inline Styles 
Javascript :: how to check if selector exists or is present puppeteer 
Javascript :: how to remove modal-backdrop fade in jquery 
Javascript :: js current time 
Javascript :: uppercase string in js 
Javascript :: node load string from file 
Javascript :: how to append select option in jquery 
Javascript :: console.log ejs 
Javascript :: react bootstrap colors not working 
Javascript :: remove session storage 
Javascript :: select2 on change 
Javascript :: how to install font-awesome 
Javascript :: add condition inside a className in reactjs 
Javascript :: check if a variable is array in javascript 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =