Detecting support of local storage

1
2
3
4
5
6
7
8
9
10
11
12
13
14
function LocalStorage(){}
extend(LocalStorage.prototype, {
isSupportCookie : function(){
return navigator.cookieEnabled;
},
isSupportUserData : function(){
var t = document.createElement('input');
return (typeof t.addBehavior !== 'undefined');
},
isSupportDOMStorage : function(){
return (typeof window.localStorage !== 'undefined');
}
});
0%