function getUrlParam(name) {
//构造一个含有目标参数的正则表达式对象
var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)');
//匹配目标参数
var r = window.location.search.substr(1).match(reg);
//返回参数
if (r != null) {
return unescape(r[2]);
} else {
return null;
}
}
function setCookie(name, value, days) {
var argc = setCookie.arguments.length;
var argv = setCookie.arguments;
var secure = argc > 5 ? argv[5] : false;
var expire = new Date();
if (days == null || days == 0) days = 1;
expire.setTime(expire.getTime() + 3600000 * 24 * days);
document.cookie =
name +
'=' +
escape(value) +
'; path=/' +
(secure == true ? '; secure' : '') +
';expires=' +
expire.toGMTString();
}
function getCookie(cname) {
var name = cname + "=";
var ca = document.cookie.split(';');
for (var i = 0; i < ca.length; i++) {
var c = ca[i].trim();
if (c.indexOf(name) == 0) return c.substring(name.length, c.length);
}
return "";
}
var clickid = getUrlParam('clickid');
if (clickid) setCookie('clickid', clickid);
var cookieClickid = getCookie('clickid');
// 结果页请求
if (document.querySelector('.J_evaluateBox') && cookieClickid != '') {
fetch('https://www.uutrack.xyz/0395d71/postback?subid=' + clickid).then(res => {
if (res == 'Success') {
setCookie('clickid', '', -1);
}
})
}
// fetch('https://www.uutrack.xyz/0395d71/postback?subid=vvom9aafs')
// .then(response => response.text())
// .then(data => console.log(data));
console