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 in react nextjs 
Javascript :: js format number thousands separator 
Javascript :: javascript get string between two parentheses 
Javascript :: disable right click 
Javascript :: installing vuex 
Javascript :: toastr.js cdn 
Javascript :: hr react 
Javascript :: mui typography bold 
Javascript :: history back js 
Javascript :: datatable scroll horizontal 
Javascript :: allow cross origin node 
Javascript :: javascript how to check for an empty object 
Javascript :: javascript get current month start and end date 
Javascript :: vue3 cdn 
Javascript :: belle delphine 
Javascript :: pass url params to child router express 
Javascript :: node js remove html tags from string 
Javascript :: jquery get option data attribute 
Javascript :: math.random javascript 
Javascript :: get window width jquery 
Javascript :: uppercase javascript 
Javascript :: jquery radio button click event 
Javascript :: jquery add option to select 
Javascript :: get window size javascript 
Javascript :: req.body is undefined 
Javascript :: ajax header jquery 
Javascript :: jquery min 
Javascript :: use icon in node js html 
Javascript :: css customize console.log 
Javascript :: js check if date is today 
ADD CONTENT
Topic
Content
Source link
Name
1+2 =