...

View Full Version : Refresh Another Window



Candrias77
07-10-2004, 11:47 AM
I have a link on my site that opens a new window. When a use is finished with the new window, I would like it to close and refresh the page that opened it. I think that I could use something like:

window.windowname.reload();
window.close();

but how would I set the 'windowname' the original page?

Any other thoughts on how this could be better are also appreciated, I am not all that hot on javascript.

Thanks.

Mr J
07-10-2004, 01:42 PM
Is the close button in the parent or the new window?

SlavaTT
07-10-2004, 01:44 PM
Hi,

in IE - window.opener.location.reload(true)
or window.opener.open('your url',_self,'size and other options (optional)')

Slava

Candrias77
07-11-2004, 05:17 AM
Mr J, the close button is in the new window.

Mr J
07-11-2004, 02:28 PM
In the popup you could go

<script>
<!--
function close_me(){
opener.location="page.htm"
self.close()
}
//->
</script>

where page.htm is the name of the opener page

glenngv
07-12-2004, 09:46 AM
Should be:


function close_me(){
if (opener && !opener.closed){ //make sure the opener window is still open
opener.location.reload();
}
window.close(); //close popup
}
...
<input type="button" value="Close" onclick="close_me()" />



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum