[thelist] JavaScript: Print Then Close

Casey aspnet at thecrookstons.com
Thu Jan 12 09:14:52 CST 2006


It's easy to send a window to the printer with Javascript, and it's just as 
wasy to close a window when a user clicks a "close window" link, but what I 
need is this: from a parent page, a user clicks on a link which opens a new 
window, prints it, and then closes it without any user ineraction other then 
clicking on the one link in the parent window.

It's all working but closing the new window:

<html>
<head>
 <title>Page to Print</title>
</head>
<body onload="printpage()">
<script language="Javascript">
<!--
function printpage() {
 window.print();
 this.window.close()
}
//-->
</script>
Text Here
</body>
</html> 




More information about the thelist mailing list