Trick with localStorage
I've been using this trick more an more lately to store data permanently in the browser.
data = JSON.parse(localStorage.getItem('data')) || [];
data.push({
name: 'Andrei',
age: 20
});
localStorage.setItem('data', JSON.stringify(data));
I've found it to be very useful. It's localStorage so it's on mobile too!
Support (http://caniuse.com/#feat=namevalue-storage)
* android 2.1
* IE 8+
* everyone else
Written by Andrei Oprea
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Localstorage
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#