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

How do you close a previous and the current window at the same time?

Status
Not open for further replies.

Kruzer

Programmer
Jun 16, 2000
117
US
By clicking a 'close' hyperlink I need the first and second window to close at the same time for exiting.

top.opener.window.close(); should have worked, I think, not sure.

function doAccept(mytarget,dofocus)
{
var preview=window.open("",mytarget,"toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=200,height=100");
top.opener.window.close();
}

...

<TD COLSPAN=&quot;3&quot; ALIGN=&quot;CENTER&quot;><A onClick=&quot;doAccept('design_help','false')&quot; TARGET=&quot;design_help&quot; HREF=&quot; ALT=&quot;Save This Tile Ad&quot; BORDER=&quot;0&quot; SRC=&quot;
 
also the 'accept.cgi' code

<html>

<head>
<script language=&quot;JavaScript&quot;>
var cprod_id = &quot;$cprod_id&quot;;

//alert(cprod_id);
function closeWindow() {

top.opener.window.close();
}

</script>
</HEAD>
<BODY BGCOLOR=&quot;#FFFFFF&quot;>
<FONT SIZE=&quot;-1&quot;>
<CENTER><b><h3>Your Tile Ad Has Been Saved !!!</h3></b> </CENTER>

<center><a href=&quot;JavaScript:close();&quot;>Close</a></center>
</FONT>
</BODY>
</HTML>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top