Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

reload a window

Status
Not open for further replies.

cklzw

Programmer
May 16, 2002
6
GB
I am using VBScript.
I open a new window by using window.open(). How can I reload
the old window when I close the new window?
 
U need to send in the new window the pathof your parent window and then use to open whend u close the new window...
O try to use in a new window the window.opener property witch is the reference of your paren window and u could use like anny window object from your parent window... ________
George, M
email : shaddow11_ro@yahoo.com
 
Something like this should work:

...
<script language=&quot;javascript&quot;>
<!--
function ReloadParent(){
window.opener.document.location.href=window.opener.document.location.href;
}
-->
</script>

<body onUnload=&quot;ReloadParent();&quot;>
...

The function 'ReloadParent' reloads the 'parent' window when the 'child' (where this code resides) is closed.
 
Infact do this instead:

...
<script language=&quot;javascript&quot;>
<!--
function ReloadParent(){
if (typeof(opener.length)!='unknown'){
opener.location.reload();
}
}
-->
</script>

<body onUnload=&quot;ReloadParent();&quot;>
...

This way you won't encounter a JavaScript error if the 'parent' window has been closed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top