作家
登录

javascript Ext JS 状态默认存储时间

作者: 来源:www.28hudong.com 2013-03-30 02:44:15 阅读 我要评论

复制代码 代码如下:Ext.state.CookieProvider = function(config){ Ext.state.CookieProvider.superclass.constructor.call(this); this.path = "/"; this.expires = new Date(new Date().getTime()+(1000*60*60*24*7)); //7 days this.domain = null; this.secure = false; Ext.apply(this, config); this.state = this.readCookies(); }; Ext.state.CookieProvider = function(config){ Ext.state.CookieProvider.superclass.constructor.call(this); this.path = "/"; this.expires = new Date(new Date().getTime()+(1000*60*60*24*7)); //7 days this.domain = null; this.secure = false; Ext.apply(this, config); this.state = this.readCookies(); }; 我们可以通过设定expires的值来改变默认的存储时间,比如: 复制代码 代码如下:this.expires: new Date(new Date().getTime()+(1000*60*60*24*365)), //一年 this.expires: new Date(new Date().getTime()+(1000*60*60*24*365)), //一年 或者我们可以在开始位置的Ext.onReady函数中加上以下的代码 复制代码 代码如下:Ext.state.Manager.setProvider( new Ext.state.CookieProvider({ expires: new Date(new Date().getTime()+(1000*60*60*24*365)), //一年 }));

  推荐阅读

  js获取提交的字符串的字节数

方法1: 复制代码 代码如下:function getBytesCount(str) { var bytesCount = 0; if (str != null) { for (var i = 0; i < str.length; i++) { var c = str.charAt(i); if (/^[u0000-u00ff]$/.test(c)) { bytesC>>>详细阅读


本文标题:javascript Ext JS 状态默认存储时间

地址:http://www.17bianji.com/kaifa2/JS/28977.html

关键词: 探索发现

乐购科技部分新闻及文章转载自互联网,供读者交流和学习,若有涉及作者版权等问题请及时与我们联系,以便更正、删除或按规定办理。感谢所有提供资讯的网站,欢迎各类媒体与乐购科技进行文章共享合作。

网友点评
自媒体专栏

评论

热度

精彩导读
栏目ID=71的表不存在(操作类型=0)