idontknow
Joined: 05 Jun 2006 Posts: 1
|
Posted: Mon Jun 05, 2006 5:27 am Post subject: reloading parent window with iframe from popup from iframe |
|
|
Hi all,
I'm having a time here with some reloading parent window madness.
I have a site that has an iframe, and on this iframe you can click links that open new windows. In these new windows there are links to other pages within the site. When the popup is closed i'd like to reload the entire site including the iframe. I have one function that does the reload
| Code: |
| opener.parent.location.reload(true); |
and this is in a function called refreshParent. i call this in the body of the popup by adding an unload event unload="refreshParent();
Now, this works well, but my problem is, if i click one of the links in the popup my functions to open the links close the pop which causes an unload, so instead of loading the expected page from the link, the site just reloads because the unload even calls refreshParent().
I'd like to have the expected page open when a link is click, and if the popup is Xed, or closed have the parent reload. I don't know how to get around this.
Extra info: the iframes and the parent are on the same domain (somedomain.com), however the parent is on myhost.somedomain.com
refreshParent()
| Code: |
function refreshParent(){
if (window.opener!=null)
{
opener.parent.location.reload(true);
}
self.close();
}
|
rdOpener() - this is the function used to open the links from the popup
| Code: |
function rdOpener(rd_url){
document.domain = "somedomain.com";
if (top!=self.parent){
top.location=self.parent.location;
}
opener.parent.location=rd_url;
window.close();
}
|
any ideas |
|