How jquery refreshes the IFRAME page

Source: Internet
Author: User

Tag:--enter button contains point cell one mode service

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")

 
<script language=" JavaScript ">
Window.location.reload ();
</script>

This will enable the page refresh, of course, there are other ways, then to refresh the framework page how we do

The code is as follows

Method 1

document.getElementById (' Frameid '). contentWindow.location.reload (true);


Method 2
document.getElementById (' youriframe '). src=src;

Instance:

  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 implements forced refresh

$ (' #iframe '). attr (' src ', $ (' #iframe '). attr (' src '));

third, if it is open new page we want to refresh, you can use the following code to brush the pro

The code is as follows
Refresh the page containing 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>)
Refresh the page of another frame with
<script language=javascript>
Parent. another FrameID.location.reload ();
</script>

Summary: a lot of document.frames (' ifrmname ') on the internet. location.reload () is no longer available.


source: http://www.3lian.com/edu/2014/10-18/173159.html

From for Notes (Wiz)

How jquery refreshes the IFRAME page

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.