提交 485ec8d8 编写于 作者: C Catouse

* fix error when local storage be disabled.

上级 26367aab
......@@ -10,15 +10,19 @@
'use strict';
var lsName = 'localStorage';
var storage = window[lsName],
var storage,
dataset,
old = window.store,
pageName = 'page_' + window.location.pathname + window.location.search;
/* The Store object */
var Store = function() {
this.slience = true;
this.enable = (lsName in window) && window[lsName] && window[lsName].setItem;
try {
if((lsName in window) && window[lsName] && window[lsName].setItem) {
this.enable = true;
storage = window[lsName];
}
} catch(e){}
if(!this.enable) {
dataset = {};
storage = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册