Revision: 61154
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at November 30, 2012 13:44 by zfisic
Initial Code
if (window.Storage) {
Storage.prototype.setObject = function(key, value) {
this.setItem(key, JSON.stringify(value));
}
Storage.prototype.getObject = function(key) {
try {
return JSON.parse(this.getItem(key));
}
catch(e) {
return null;
}
}
}
Initial URL
Initial Description
Provides getter/setter functionality for objects in local storage. Utilizes JSON.stringify and JSON.parse.
Initial Title
Augment Storage Prototype with getObject, setObject
Initial Tags
Initial Language
JavaScript