/**Cookie帮助类*/ var CK = { Set: function (name, value) { var days = 30; var exp = new Date(); exp.setTime(exp.getTime() + days * 24 * 60 * 60 * 1000); document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString(); } , Get: function (name) { var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)"); if (arr = document.cookie.match(reg)) return (arr[2]); else return null; }, Dele: function (name) { exp.setTime(exp.getTime() - 1); var cval = Get(name); if (cval != null) { document.cookie = name + "=" + cval + ";expires=" + exp.toGMTString(); } } }