PDA

View Full Version : referencing opener


sc0rpius
08-08-2005, 02:21 PM
Hi,

I have a problem referencing opener window from a popup with a frameset.

What i need to be able to do is, load a linked product in the opener window, focus the opener window and close the popup.

I had this code for testing in my popup, but no frames.

function butterflyEffect(url) {
opener.parent.location.href = url;
opener.parent.focus();
window.close();
}

The actual page that popups hase frames in it and the code doesn't work anymore.

I tried to find the solution on the web but failed at it.

Has anyone of you guys any idea on how to resolve it?

Thanks in advance!

glenngv
08-08-2005, 02:28 PM
The popup has frames in it and you want to change the url of the popup's opener window?

function butterflyEffect(url) {
if (top.opener && !top.opener.closed){
top.opener.location.href = url;
top.opener.focus();
}
window.close();
}

sc0rpius
08-08-2005, 03:34 PM
Yep exactly!

I tried your solution but it doesn't work...
please note that i'm testing in both firefox ans IE...

As for frameset i have top and bottom frame, and only the top frame is trying to target the opener window.

glenngv
08-09-2005, 03:34 AM
Can you tell me what exactly happens instead of saying it doesn't work?