查看完整版本: 网页跳转代码大全 301 404

admin 2007-10-11 03:01

网页跳转代码大全 301 404

[code]三种网页跳转代码:
如果你要在服务器端跳转,可以这样:

Response.Redirect(ewuu.cn)
Response.End

如果你要在客户端跳转,可以这样:

<script
language="javascript"
type="text/javascript">window.location="http://ewuu.cn";;</script>

如果你要让页面显示几秒钟之后跳转,可以在html代码的<head></head>部分加上这样的代码:

<meta
http-equiv="refresh" content="3;
url=http://ewuu.cn">
(3秒钟后自动跳转到ewuu.cn)

以上加在<body></body>之间就可,这三种是比较常见常用的网页跳转代码,当然还有别的,大家可以自己收集。[/code][code]

不隐藏转向之后的地址 代码一:
<html>
<body>
<form
name=loading>
<P align=center><FONT face=Arial color=#0066ff
size=2>loading...</FONT> <INPUT
style="PADDING-RIGHT: 0px;
PADDING-LEFT: 0px; FONT-WEIGHT: bolder; PADDING-BOTTOM: 0px; COLOR: #0066ff;
BORDER-TOP-style: none; PADDING-TOP: 0px; FONT-FAMILY: Arial;
BORDER-RIGHT-style: none; BORDER-LEFT-style: none; BACKGROUND-COLOR: white;
BORDER-BOTTOM-style: none"
size=46 name=chart>
<INPUT

style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT:
medium none; COLOR: #0066ff; BORDER-BOTTOM: medium none; TEXT-ALIGN: center"

size=47 name=percent>
<SCRIPT>
var bar=0
var line="||"

var amount="||"
count()
function count(){
bar=bar+2
amount
=amount + line
document.loading.chart.value=amount

document.loading.percent.value=bar+"%"
if (bar<99)

{setTimeout("count()",100);}
else
{window.location = "将这里改成要转入的网址";}

}</SCRIPT>
</P></form>
</body>
</html>


不隐藏转向之后的地址 代码二:
<html>
<body>
<script
language="javascript">
<!--
function goToURL() { //v2.0
for (var
i=0; i< (goToURL.arguments.length - 1); i+=2) //with arg
pairs
eval(goToURL.arguments+".location=''"+goToURL.arguments[i+1]+"''");
document.returnvalue
= false;
}
//-->
</script>
<body bgcolor="#FFFFFF"
onLoad="goToURL(''parent'',''将这里改成要转入的网址'');return
document.returnvalue">
</body>
</html>

不隐藏转向之后的地址
代码三:
<html>
<SCRIPT LANGUAGE="javascript">
<!-- Start
Code
var ver = navigator.appVersion;
if (ver.indexOf("MSIE") !=
-1)
{
window.location.href="将这里改成要转入的网址"
}else
window.location.href="将这里改成要转入的网址"
//
End Code -->
</SCRIPT>
</html>

不隐藏转向之后的地址
代码四:
<html>
<body>
<meta http-equiv="refresh"
content="0.1;url=将这里改成要转入的网址">
</body>
</html>

可隐藏转向之后的地址:
<html>
<frameset framespacing="0" border="0"
rows="0" frameborder="0">
<frame name="main" src="将这里改成要转入的网址"
scrolling="auto" noresize>
</frameset>
</html> [/code]

国际网民 2008-7-7 00:26

[code]<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>404 - Page Not Found</title>
<body bgcolor="#DFEBFA">
<center>
<table>
        <tr><img src="./images/404.gif"></tr>
</table>
</center>
<meta http-equiv="refresh" content="3;url=http://www.discuz.net/">
</body>
</html>[/code]
页: [1]
查看完整版本: 网页跳转代码大全 301 404