当我们访问某个网页时会自动引领进入一个新的页面,如访问我以前的博客http://www.grnnet.cn/blog,会自动引入到新的博客地址。可以通过下面几种方法来实现:
方法一(html方法):在网页头部也就是<head></head>之间加入下面代码<meta http-equiv="refresh" content="0.1;url=http://www.grnnet.com">即可实现。如将下面代码存储为default.html,访问时就会自动转入本站。
<html>
<head>
<meta http-equiv="Content-Language" content="zh-CN">
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<meta http-equiv="refresh" content="0.1;url=http://www.grnnet.com">
<title>跳转</title>
</head>
<body>
</body>
</html>
方法二(java脚本方法):在网页文件中加入如下脚本代码也可实现跳转,但需要浏览器支持脚本运行。
<script>
setTimeout("javascript:location.href='http://www.grnnet.com'",0);
</script>
方法三(ASP方法):在网页中加入如下ASP代码即可,注意要把网页文件要存储为ASP格式,服务器还要支持ASP。
<% Response.Redirect"http://www.grnnet.com/default.html" %>
原创文章如转载,请注明:转载自晓宁博客〖http://www.grnnet.com/〗
本文链接地址:http://www.grnnet.com/post/170.html


