日期:2014-05-16  浏览次数:20308 次

【转】js刷新页面方法大全

一、先来看一个简单的例子:?
下面以三个页面分别命名为frame.html、top.html、bottom.html为例来具体说明如何做。?
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>?

现在假设top.html (即上面的页面) 有七个button来实现对bottom.html (即下面的页面) 的刷新,可以用以下七种语句,哪个好用自己看着办了。?
top.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>