复制代码 代码如下: 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; } };
推荐阅读
JQuery EasyUI 对话框的使用方法
下面看一下EasyUI的对话框效果图 js代码: 复制代码 代码如下: <script language="javascript" type="text/javascript"> function Open_Dialog() { $('#mydialog').show(); $('#mydialog').dialog({ collapsible: >>>详细阅读
本文标题:一个简单的JavaScript数据缓存系统实现代码
地址:http://www.17bianji.com/kaifa2/JS/25565.html
1/2 1