| 框架页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> <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> |