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

Window Close

Status
Not open for further replies.

pancake

Programmer
Aug 21, 2001
88
GB
Hi Guys,

I am trying to open another window in a browser, get it to print and then close, leaving the original window open.

I can open the window, and then print - Using
<body onLoad=&quot;window.print()&quot;>

But I can't seem to get the window to close after the print dialog box.

Any suggestions greatly appreciated

Thanks
 
from you main page open the window using script


<html>
<head>
</head>
<body>
<script language=javascript>
function openPrint()
{
var printwin = window.open('print.htm');
}
</script>
<a href=&quot;#&quot; onclick=&quot;openPrint();return false&quot;>pop</a>
</body>
</html>


and then in the body tag of print.htm, or your print file:

<body onLoad=&quot;window.print(); window.close()&quot;>
this gets printed
</body>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top