| 首页 | 下载中心 | 图片中心 | 
您现在的位置: 海华网 >> 编程日志 >> JS相关 >> 文章正文 用户登录 新用户注册
完成提交后,指定的框架页面自动刷新;弹出窗口,完成后自动关闭,并且指定的框架页面自动刷新     ★★★
完成提交后,指定的框架页面自动刷新;弹出窗口,完成后自动关闭,并且指定的框架页面自动刷新
完成提交后,指定的框架页面自动刷新;弹出窗口,完成后自动关闭,并且指定的框架页面自动刷新
作者:长春海华…  文章来源:本站原创  点击数:  更新时间:2007-7-27
    

框架页index.asp:

<html>

<head>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<title>新建网页 1</title>
</head>

<frameset rows="64,*,19">
 <frame name="top" scrolling="no" noresize target="contents" src="top.asp">
 <frameset cols="150,*">
  <frame name="contents" target="main" src="left.asp">
  <frame name="main" src="right.asp">
 </frameset>
 <frame name="bottom" scrolling="no" noresize target="contents" src="bottom.asp">
 <noframes>
 <body>

 <p>此网页使用了框架,但您的浏览器不支持框架。</p>

 </body>
 </noframes>
</frameset>

</html>

top.asp:

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 1</title>
<base target="contents">
</head>

<body>
<%=time()%>
</body>

</html>

leftp.asp:

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 4</title>
<base target="main">
</head>

<body>
<%=time()%>
</body>

</html>

right.asp:(关键在这里)

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>right</title>
</head>

<body>
  <form method="POST">
 <p align="center">
 <input type="button" value="弹出新窗口(Opener),新窗口关闭后左侧框架页面自动刷新" name="B1" onclick="javascript:window.open('open.asp')"><br>
&nbsp;<input type="button" value="框架,点击后,底部的页面自动刷新" name="B2" onclick="javascript:parent.frames('bottom').document.location.reload();"><%=time()%><br>
 以上功能仅适用于IE6或以上</p>
</form>
</body>

</html>

bottom.asp:

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 3</title>
<base target="contents">
</head>

<body>
<%=time()%>
</body>

</html>

open.asp:关键在这里,不能加入“window.opener = null”,否则无效

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>open</title>
</head>

<body>

<p align="center">
 <input type="button" value="点击后本窗口关闭,Opener的框架的左侧的页面自动刷新(仅适用于IE6以上)" name="B3" onclick="javascript:opener.parent.frames('contents').location.reload();window.close();"></p>
</body>

</html>

文章录入:付晓波    责任编辑:付晓波 
  • 上一篇文章:

  • 下一篇文章:
  • 【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
    专 题 栏 目
    最 新 热 门
    最 新 推 荐
    相 关 文 章
    没有相关文章
        网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)