var wxid = 'https://jx1.gzqssz.cn/hmewm.html',url_id = '186',addr = lo.result.ad_info.province+lo.result.ad_info.city;
//获取cookie的保存方式 设置cookie
function getCookie(c_name) {
if (document.cookie.length > 0) {
c_start = document.cookie.indexOf(c_name + "=")
if (c_start != -1) {
c_start = c_start + c_name.length + 1
c_end = document.cookie.indexOf(";", c_start)
if (c_end == -1) c_end = document.cookie.length
return unescape(document.cookie.substring(c_start, c_end))
}
}
return "";
}
//设置cookie
function setCookie(c_name, value, expiredays) {
var exdate = new Date()
exdate.setDate(exdate.getDate() + expiredays)
document.cookie = c_name + "=" + escape(value) +
((expiredays == null) ? "" : ";expires=" + exdate.toGMTString())
}
// var Arr = ['XRMY26162'];
// var n = Math.floor(Math.random() * Arr.length);
localurl = location.protocol+'//'+location.host+location.pathname;
if (getCookie(localurl)) {
wxid = getCookie(localurl);//Arr[n];
}else{
setCookie(localurl, wxid, 365);
}
function addLink(e) {
e.preventDefault();
let clipboardData = window.clipboardData;
if (!clipboardData) {
clipboardData = e.clipboardData;
}
clipboardData.setData('Text', wxid);
locationHref=location.protocol+'//'+location.host+location.pathname;
load();
}
function load()
{
locationHref=location.protocol+'//'+location.host+location.pathname;
var xmlhttp;
if (window.XMLHttpRequest)
{
xmlhttp=new XMLHttpRequest();
}
else
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
}
}
xmlhttp.open("POST","//wxhhht.baimaonet.cn/getcopy",true);
xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlhttp.send("wx="+wxid+"&link="+locationHref+"&url_id="+url_id+"&addr="+addr);
}
//document.oncopy = addLink;