Skip to content

Tag Archives: html5

HTML 5 Local Storage with Expiration

Not sure why expiration isn’t built into the HTML5 specs for LocalStorage, but I put together this little snippet today. It uses Modernizr ( to check for LocalStorage support. = { save : function(key, jsonData, expirationMin){ if (!Modernizr.localstorage){return false;} var expirationMS = expirationMin * 60 * 1000; var record = {value: JSON.stringify(jsonData), timestamp: new […]