tabulator-tables
Version:
Interactive table generation JavaScript library
13 lines (11 loc) • 404 B
JavaScript
//write persistence information to storage
export default {
local:function(id, type, data){
localStorage.setItem(id + "-" + type, JSON.stringify(data));
},
cookie:function(id, type, data){
var expireDate = new Date();
expireDate.setDate(expireDate.getDate() + 10000);
document.cookie = id + "-" + type + "=" + JSON.stringify(data) + "; expires=" + expireDate.toUTCString();
}
};