Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Making Use of HTML5 Storage.
There's one thing you forgot to mention. You can also add arrays and objects to HTML5 Storage using JSON.parse and JSON.stingify as listed below.
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));
I literally got this from stackoverflow (http://stackoverflow.com/questions/2010892/storing-objects-i...)
Coincidentally I was building a small javascript bookmarklet for myself this weekend using localStorage. The bookmarklet allows you to make playlists on the fly. Check it out on http://www.jefvlamings.com/projects/Youtube/
There are no comments on this comment yet.
There's one thing you forgot to mention. You can also add arrays and objects to HTML5 Storage using JSON.parse and JSON.stingify as listed below.
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));
I literally got this from stackoverflow (http://stackoverflow.com/questions/2010892/storing-objects-i...)
Coincidentally I was building a small javascript bookmarklet for myself this weekend using localStorage. The bookmarklet allows you to make playlists on the fly. Check it out on http://www.jefvlamings.com/projects/Youtube/