pop-up and printing

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
HormonX
Forum Commoner
Posts: 50
Joined: Tue Dec 10, 2002 7:43 pm
Location: Toronto

pop-up and printing

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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>
Post Reply