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

JS实现刷新iframe的方法2

iframe中刷新父页面方法及一些按钮刷新代码集合【原创+转】2009-07-23 11:12a页面里iframe了个b页面,我想实现在b页面里一个按钮,一按就刷新a页面,也就是父页面,不是只刷新iframe里面的b页面 哦~

请问b页面里的 <input type="button" class="btn" value=" 返 回 " onclick="history.back();">那个onclick 要怎么写呢?啊哈

答案是:parent.location.reload() ;


以下是网上的:

十一种刷新按钮的方法。很不错的,经常上网要找。哈哈。这下放这里了。
<input type=button value=刷新 onclick="history.go(0)">
<input type=button value=刷新 onclick="location.reload()">
<input type=button value=刷新 onclick="location=location">
<input type=button value=刷新 onclick="location.assign(location)">
<input type=button value=刷新 onclick="document.execCommand('Refresh')">
<input type=button value=刷新 onclick="window.navigate(location)">
<input type=button value=刷新 onclick="location.replace(location)">
<input type=button value=刷新 onclick="window.open('自身的文件','_self')">
<input type=button value=刷新 onClick=document.all.WebBrowser.ExecWB(22,1)>
<OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0> </OBJECT>
<form action="自身的文件">
<input type=submit value=刷新>
</form>
<a id=a1 href="自身的文件"> </a>
<input type=button value=刷新 onclick="a1.click()">