`
wyzxzws
  • 浏览: 379214 次
  • 性别: Icon_minigender_1
  • 来自: dazhou
社区版块
存档分类
最新评论

页面跳转与关闭

阅读更多
如何自动转到另外一个网页:
<META HTTP-EQUIV="Refresh" Content="2;URL=other.htm">
也可以用这个:
<script>setTimeout("window.location.href='other.htm'",2000)
注意,前一个时间单位是秒,后一个时间单位是豪秒!(后一个可扩展性和灵活性强得多。)

跳转到另一页面同时另一页面规定时间内自动关闭
first.htm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<title>无标题文档</title>
//方法一:
<script>
var wind=null;
wind=open("index.htm","","width=800,height=800");
setTimeout("wind.close()",1000);
</script>
</head>

<body onLoad="self.open('index.htm','MyName','null');">//此处代码实现打开该页时直接打开index.htm页
<h3><a href="#" onclick="window.open('index.htm','null','width=400px,height=200px')">open
</a> </h3>
或者是:<a href="#" onclick="self.open('index.htm','null','width=400px,height=200px')">open
</a>
</body>
</html>

index.htm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<script>setTimeout("window.close()",10000);
或者是:setTimeout("self.close()",10000);
</script>
</head>
<body>
<a href="#" onclick="self.close()">关闭</a>
</body></html>

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics