网站自动跳转代码
对于静态的页面:<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2900.2769" name=GENERATOR>
<meta http-equiv="refresh" content="1;url=http://www.xlin.cn">
</HEAD>
<BODY text=#000000 link=#000000 bgColor=#ffffff background="">
</BODY></HTML>
或者下面的:
=================
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>用户登录</title>
<OBJECT id=closes type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
<param name="Command" value="Close">
</object>
</head>
<body>
<script language="JavaScript">
<!--
HeightValue=screen.height;
WidthValue=screen.width;
newwin=window.open("http://www.xlin.cn","new",
"width=800,height=600,fullscreen=0,toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,resizable=1,left=0,top=0");
newwin.moveTo(-3,-3);
newwin.resizeTo(WidthValue+6,HeightValue-23);
// -->
</script>
</body>
</html>
============================
对于动态的页面(asp): (此命令跳转意思:打开www.abc.com 会直接跳转到www.abc.cn 上 客户端地址都会显示的都是cn尾数的 )
<%
Response.Redirect "http://www.xlin.cn"
%>
在实现页面跳转的时候,有些人喜欢用Response.Redirect,而有些人则喜欢用Server.Transfer。
根本上,Response是叫浏览器去重新转向到指定的网页,而Server自然是发生在服务器端为主了,因此会有以下区别:
1. Server.Transfer只能够转跳到本地虚拟目录指定的页面,而Response.Redirect则十分灵活;
2. Server.Transfer可以将页面参数方便传递到指定页面;
3. 使用时,Server.Transfer跳到别的页面后,浏览器显示的地址不会改变,有时反而会造成误会,当然也有些场合需要这样的效果;
4. Server.Transfer可以减少客户端对服务器的请求;