By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,813 Members | 1,236 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,813 IT Pros & Developers. It's quick & easy.

location reload on window close

P: n/a
I'm popping a window to a page with a different dns than the parent, and
i want the opener's location reloaded when this window is closed.

With Mozilla it seems that all the opener's methods and properties are
protected because the dns are different. A security exception
(permission denied) is thrown every time i try to exec an
"opener.location.reload()" from the pop up window.

An alternative would be catching the window closing from the opener, but
i don't know how this could be done.

Thanks in advance.
alex.
Jul 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
En/na alex bazan ha escrit:
I'm popping a window to a page with a different dns than the parent, and
i want the opener's location reloaded when this window is closed.

With Mozilla it seems that all the opener's methods and properties are
protected because the dns are different. A security exception
(permission denied) is thrown every time i try to exec an
"opener.location.reload()" from the pop up window.

An alternative would be catching the window closing from the opener, but
i don't know how this could be done.

Thanks in advance.
alex.

done :)

dialogwin=new Object()

function openwindow (url,name,attr) {
dialogwin=window.open(url,name,attr);
checkwindowclose();
}

function checkwindowclose () {
if (dialogwin.closed) {
location.reload();
} else {
setTimeout("checkwindowclose",500);
}
}
Jul 23 '05 #2

P: n/a
Well, as you said, you can try and detect the closing of the window
from the opener. this function sould do it:

w = open(...) //the variable w points to the new popup window
isClosed()

function isClosed(w)
{
if w.closed()
location.reload()
else
setTimeout('isClosed(w)', 500)
}
On Tue, 19 Apr 2005 12:13:58 +0200, alex bazan <me@privacy.net> wrote:
I'm popping a window to a page with a different dns than the parent, and
i want the opener's location reloaded when this window is closed.

With Mozilla it seems that all the opener's methods and properties are
protected because the dns are different. A security exception
(permission denied) is thrown every time i try to exec an
"opener.location.reload()" from the pop up window.

An alternative would be catching the window closing from the opener, but
i don't know how this could be done.

Thanks in advance.
alex.


Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.