Page 1 of 1

pop-up and printing

Posted: Mon Jan 03, 2005 11:04 am
by HormonX
Can anyone help me with this issue ... i have a pop-up window that popsup when a button is pressed. I need to send the contents of the popup to the printer. This is what i have but it doesn't open up pronter window ... can anyone help ?

Code: Select all

<script language="JavaScript">
<!--
var howManySeconds = 1

function pause() &#123;
   myTimer=setTimeout("printWindow()",howManySeconds*1000)
&#125;

function printWindow() &#123;
   window.print()
&#125;
//-->
</script>
Thank you

Greg

Posted: Mon Jan 03, 2005 11:41 am
by feyd
Works for me in IE6 SP2 and Firefox. I did have to enable blocked content in IE through the little yellow bar that pops in.

Code: Select all

<html><script language="JavaScript">
<!--
var howManySeconds = 1

function pause() &#123;
   myTimer=setTimeout("printWindow()",howManySeconds*1000)
&#125;

function printWindow() &#123;
   window.print()
&#125;
//-->
</script>
<body onload="pause()">wait for print.</body></html>