skij
asked on
JavaScript: Getting data from objects with localStorage
Using JavaScript, how can I access data from an object stored with local storage? This does not work:
This does not work:
This does not work:
localStorage.setItem('data', {color:'red', number:5});
alert( localStorage.getItem('data').color );
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Thanx 4 axxepting
ASKER
I have asked a related question here:
https://www.experts-exchange.com/questions/28735219/JavaScript-Storing-and-retrieving-objects-with-localStorage.html
https://www.experts-exchange.com/questions/28735219/JavaScript-Storing-and-retrieving-objects-with-localStorage.html