location reload on window close

A

alex bazan

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.
 
A

alex bazan

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);
}
}
 
A

Arik Segal

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,738
Latest member
JinaMacvit

Latest Threads

Top