欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

一個簡單的JavaScript數(shù)據(jù)緩存系統(tǒng)實現(xiàn)代碼

 更新時間:2010年10月24日 17:53:29   作者:  
數(shù)據(jù)緩存系統(tǒng),主要是將一些可復用的數(shù)據(jù)臨時存放一下,放下數(shù)據(jù)后面的再次調(diào)用。
復制代碼 代碼如下:

var DataCache = function(){
if(!(this instanceof DataCache)){
return new DataCache();
}
this.id = 0;
this.caches = {};
};
DataCache.prototype = {
add : function(val){
val = val || null;
key = "dc_" + this.id;

this.caches[key] = val;
return key;
},
remove : function(key){
delete this.caches[key];
},
get : function(key){
return this.caches[key];
},
set : function(key,val){
this.caches[key] = val;
}
};

相關文章

最新評論