$(document).ready(function(e) {
var popUp = getCookie("popUp");
var randomCodePage = getCookie("randomCodePage");
var randomCode = document.getElementById("randomCode");
randomCode.innerHTML = randomCodePage;
var url = window.location.href;
//根据线上URL判断是否是注册成功页
var successsPage = url.indexOf("registerOk", 0);
console.info(successsPage);
if(popUp != null && popUp != ""){
if(successsPage == 27){ //线上环境是27
$('.xdtzc-tc').show();
$('.xdtzc-tc-hb').hide();
}else{
$('.xdtzc-tc').hide();
$('.xdtzc-tc-hb').show();
}
}
$('.xdtzc-tc-cont i').click(function(){
$('.xdtzc-tc').hide();
$('.xdtzc-tc-hb').show();
});
$('.xdtzc-tc-hb').click(function(){
$('.xdtzc-tc-hb').hide();
$('.xdtzc-tc').show();
});
})
//获取Cookie值
function getCookie(cname) {
var name = cname + "=";
var ca = document.cookie.split(';');
for(var i=0; i<ca.length; i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1);
if (c.indexOf(name) != -1) return c.substring(name.length, c.length);
}
return "";
}
js 获取cookie 值
最新推荐文章于 2024-03-25 22:14:19 发布