localStorage的存储、获取、删除操作
var store={
// 保存
save:function(key,value){
localStorage.setItem(key,JSON.stringify(value));
},
// 获取
fetch:function(key){
return JSON.parse(localStorage.getItem(key)) || [];
},
delete: function (key) {
localStorage.removeItem(key);
}
};
批量删除localStorage: localStorage.clear();