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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Close popup window

Status
Not open for further replies.

ketankshah

IS-IT--Management
Jan 11, 2001
121
0
0
IN
I want to close a popup window which was opened from window A, on onload event of window B. How can I do that?

My code is as below:

WindowA.htm
-----------
<HTML>
<BODY>
<SCRIPT LANGUAGE=&quot;JavaScript&quot; TYPE=&quot;text/javascript&quot;>
<!--
function gotonext(){
test = window.open(&quot;..\popup.htm&quot;,&quot;test&quot;,'scrollbars=no,width=499,height=500,left=0,top=0');

window.location = &quot;WindowB.htm&quot;
}
//-->
</SCRIPT>
<form action=&quot;javascript:gotonext()&quot; method=&quot;post&quot;>
<input type=&quot;Submit&quot; value=&quot;OK&quot;>
</form>
</BODY>
</HTML>


WindowB.htm
-----------
<HTML>
<BODY onload='window.opener.test.close()'>
Data retrieved
</BODY>


Popup.htm
-----------
<HTML>
<BODY onload='window.opener.test.close()'>
Please Wait ....
</BODY>
 
<BODY onload='test.close()'>
will work. It doesn't need to be:
<BODY onload='window.opener.test.close()'>

Rick
 
I tried this also but still it is not finding the window test in WindowB.htm and gives error in onload event.

Sorry about the code in popup.htm. There is no onload event in this page. The code is as follows:

Popup.htm
-----------
<HTML>
<BODY>
Please Wait ....
</BODY>


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top