日期:2014-05-16 浏览次数:20322 次
frame.html 由上(top.html)下(bottom.html)两个页面组成,代码如下: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE> frame </TITLE> </HEAD> <frameset rows="50%,50%"> <frame name=top src="top.html"> <frame name=bottom src="bottom.html"> </frameset> </HTML>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE> top.html </TITLE> </HEAD> <BODY> <input type=button value="刷新1" onclick="window.parent.frames[1].location.reload()"><br> <input type=button value="刷新2" onclick="window.parent.frames.bottom.location.reload()"><br> <input type=button value="刷新3" onclick="window.parent.frames['bottom'].location.reload()"><br> <input type=button value="刷新4" onclick="window.parent.frames.item(1).location.reload()"><br> <input type=button value="刷新5" onclick="window.parent.frames.item('bottom').location.reload()"><br> <input type=button value="刷新6" onclick="window.parent.bottom.location.reload()"><br> <input type=button value="刷新7" onclick="window.parent['bottom'].location.reload()"><br> </BODY> </HTML>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE> bottom.html </TITLE> </HEAD> <BODY onload="alert('我被加载了!')"> <h1>This is the content in bottom.html.</h1> </BODY> </HTML>
<script language="JavaScript"> function myrefresh() { window.location.reload(); } setTimeout('myrefresh()',1000); //指定1秒刷新一次 </script>