(function (win, doc) { // function matchCookie(cookieName) { // var res = doc.cookie.match(new RegExp("(^| )" + cookieName + "=([^;]*)(;|$)")); // return null != res ? unescape(res[2]) : null; // } function setCookie(name, value, max_age) { max_age = max_age || 15; var exp = new Date(); exp.setTime(new Date().getTime() + max_age * 1000); doc.cookie = name + "=" + escape(value) + ";path=/;expires=" + exp.toGMTString(); } if (!win.performance) { return; } // if (matchCookie('PMS_JT')) { // return; // } setCookie("PMS_JT", '({"s":' + (+win.performance.timing.navigationStart) + ',"r":"' + doc.referrer.replace(/#.*/, "") + '"})'); })(window, document)
// 抄的老代码 if (!sessionStorage.getItem('isSearch') && !sessionStorage.getItem('pageSource')) { sessionStorage.setItem('isSearch', (window.TB_CONFIG || {}).searchInfo.isSearch); sessionStorage.setItem('pageSource', (window.TB_CONFIG || {}).searchInfo.pageSource); } else if (document.referrer && (window.TB_CONFIG || {}).searchInfo.pageSource !== 'tieba' && (window.TB_CONFIG || {}).searchInfo.pageSource !== sessionStorage.getItem('pageSource')) { sessionStorage.setItem('isSearch', (window.TB_CONFIG || {}).searchInfo.isSearch); sessionStorage.setItem('pageSource', (window.TB_CONFIG || {}).searchInfo.pageSource); }