js代码|首次进入网站跳转到其他网页(js 跳转网页)
时间:2021-07-16 19:20:42 阅读:869
<script language="JavaScript">
function GetCookie(Name) {
var search = Name + "="
var Cookie =document.cookie;
if (Cookie.length <= 0 )return "";// cookie 不存在,返回空值
if (Cookie.indexOf(search)==-1)return "";// 'visited' 不存在,返回空值
start = Cookie.indexOf(search)+ search.length//"visited=yes"起始位置索引值
end = Cookie.indexOf(";", start);//"visited=yes"终止位置索引值
if (end == -1);//";"不存在
end = Cookie.length;
return unescape(Cookie.substring(start, end))
}
function SetCookie(){
if (GetCookie('visited')==''){
document.cookie="visited=yes"
document.location.href="https://www.hutoucun.cn/";//修改为:https://www.hutoucun.cn/
}
}
SetCookie()
//-->
</script>首次进去网站,会去一次https://www.hutoucun.cn/
至于怎么玩,就看个人了


网友评论