【转】js刷新页面步骤大全
【转】js刷新页面方法大全一、先来看一个简单的例子:?下面以三个页面分别命名为frame.html、top.html、bottom.h
【转】js刷新页面方法大全
一、先来看一个简单的例子:?
下面以三个页面分别命名为frame.html、top.html、bottom.html为例来具体说明如何做。?
frame.html 由上(top.html)下(bottom.html)两个页面组成,代码如下:?
<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>?
下面是bottom.html页面源代码,为了证明下方页面的确被刷新了,在装载完页面弹出一个对话框。?
其中20指每隔20秒刷新一次页面.?
2.页面自动跳转:把如下代码加入<head>区域中?
<meta http-equiv="refresh" content="20;url=http://www.jb51.net">?
其中20指隔20秒后跳转到http://www.jb51.net页面?
3.页面自动刷新js版?
<script language="javascript">?
window.opener.document.location.reload()?
</script>?