The 1,reload method, which forces the browser to refresh the current page.
Syntax: Location.reload ([Bforceget])
Parameters: Bforceget, optional parameter, default is False, the current page is taken from the client cache. True, the latest page from the server is taken as a GET, equivalent to the client clicking F5 ("Refresh")
| 123 |
<script language="JavaScript">window.location.reload();</script> |
| 1234567 |
//方法1document.getElementById(‘FrameID‘).contentWindow.location.reload(true);//方法2document.getElementById(‘youriframe‘).src=src; |
Instance:
| 12345678910 |
<iframe id="myframe" width="100%" frameBorder="0" src="test.html" scrolling="no"></iframe><inputtype="button" onclick="javascript:refreshFrame();" value="Refresh Frame" /> <scripttype="text/javascript"><!--function refreshFrame(){ document.getElementById(‘myframe‘).contentWindow.location.reload(true);}//--></script> |
Two. jquery implements forced refresh
$ (' #iframe '). attr (' src ', $ (' #iframe '). attr (' src '));
| 12345678910111213 |
//刷新包含该框架的页面用 <scriptlanguage=JavaScript> parent.location.reload();</script>//子窗口刷新父窗口<scriptlanguage=JavaScript> self.opener.location.reload();</script>( 或 <ahref="javascript:opener.location.reload()">刷新</a> )//刷新另一个框架的页面用 <scriptlanguage=JavaScript> parent.另一FrameID.location.reload();</script> |
Summary: A lot of document.frames (' Ifrmname ') on the Internet. Location.reload () is no longer available.
Self-validation
Dynamically loading the contents of a subform in a page,
| 123 |
$("#refresh").click(function(){ parent.location.reload();}); |
Refresh the current Subform
$ ("#refresh"). Click (function () { self.location.reload (); });
Can work
How jquery refreshes the IFRAME page