1,reload method that forces the browser to refresh the current page.
Syntax: Location.reload ([Bforceget])
Parameters: Bforceget, optional parameter, default to False, take the current page from the client cache. True to get the latest page from the service, equivalent to the client-click F5 ("Refresh")
The code is as follows |
|
<script language= "JavaScript" > Window.location.reload (); </script> |
This enables the page to refresh, of course, there are other ways, then to refresh the frames page How do we operate
The code is as follows |
|
Method 1
document.getElementById (' Frameid '). ContentWindow.location.reload (True);
Method 2 document.getElementById (' Youriframe '). src=src; |
Instance:
The code is as follows |
|
<iframe id= "MyFrame" width= "100%" frameborder= "0" src= "test.html" scrolling= "no" ></iframe> <input type= "button" onclick= "Javascript:refreshframe ();" Value= "Refresh Frame"/>
<script type= "Text/javascript" > <!-- function Refreshframe () { document.getElementById (' MyFrame '). ContentWindow.location.reload (True); } --> </script> |
Two. jquery Implementation Force Refresh
$ (' #iframe '). attr (' src ', $ (' #iframe '). attr (' src '));
Third, if it is open new page we want to refresh the words can use the following code to brush Pro
The code is as follows |
|
Refresh the page that contains the frame with <script language=javascript> Parent.location.reload (); </script> child window refreshes parent window <script language=javascript> Self.opener.location.reload (); </script> (or <a href= "javascript:opener.location.reload ()" > Refresh </a>) The page that refreshes another frame is used <script language=javascript> Parent. Another FrameID.location.reload (); </script> |
Summary: A lot of document.frames on the net (' Ifrmname '). Location.reload () is no longer available.