Cookie 判断页面是否为第一次打开 包括刷新


$.cookie = function(e, t, n) {
if(arguments.length > 1 && (!/Object/.test(Object.prototype.toString.call(t)) || t === null || t === undefined)) {
n = $.extend({}, n);
if(t === null || t === undefined) {
n.expires = -1
}
if(typeof n.expires === "number") {
var r = n.expires,
i = n.expires = new Date;
i.setDate(i.getDate() + r)
}
t = String(t);
return document.cookie = [encodeURIComponent(e), "=", n.raw ? t : encodeURIComponent(t), n.expires ? "; expires=" + n.expires.toUTCString() : "", n.path ? "; path=" + n.path : "", n.domain ? "; domain=" + n.domain : "", n.secure ? "; secure" : ""].join("")
}
n = t || {};
var s = n.raw ? function(e) {
return e
} : decodeURIComponent;
var o = document.cookie.split("; ");
for(var u = 0, a; a = o[u] && o[u].split("="); u++) {
if(s(a[0]) === e) return s(a[1] || "")
}
return null
}


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM