Skip to content

Instantly share code, notes, and snippets.

@david-martin
Forked from feedhenry-gists/gist:1015194
Created November 14, 2011 10:14
Show Gist options
  • Save david-martin/1363666 to your computer and use it in GitHub Desktop.
Save david-martin/1363666 to your computer and use it in GitHub Desktop.
Local Storage Call
// Save
$fh.data({
"act": "save",
"key": "foo",
"val": "bar"
}, function () {
// save success
}, function (code) {
// save failed
} );
// Load
$fh.data( {
"key": "foo"
}, function (res) {
console.log(res.key + '=' + res.val);
// expected output => foo=bar
}, function (code) {
// load failed
});
// Remove
$fh.data( {
"act": "remove",
"key": "foo"
}, function () {
// remove success
}, function (code) {
// remove failed
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment