网页怎样实现只跳转一次

来源:百度知道 编辑:UC知道 时间:2024/05/25 16:31:27
<title>登陆成功</title>
<meta http-equiv="refresh" loop="1" content="8;url=http://xxx">
</head>
<body>
aaa
</body>
</html>

loop 没用``网页还是每8秒跳转一次,怎样实现只跳转一次就不跳了

使用Cookie记录是否已跳转过:

<SCRIPT language="JavaScript">
<!--
function refreshUrl(){
self.location='http://www.woyulu.com';
}
function getCookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length>0){
offset = document.cookie.indexOf(search)
if (offset!=-1){
offset += search.length;
end = document.cookie.indexOf(";", offset);
if(end == -1)
end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}
function window.onload(){
if (getCookie('refresh')==''){
refreshUrl();
document.cookie="refresh=yes";
}
}
//-->
</SCRIPT>

<title>登陆成功</title&g