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

onLoad Print

Status
Not open for further replies.

dakoz

Programmer
Feb 2, 2002
74
hi all,

i have the following question :

i want when someone enters a specific page after the page is loaded and all the content with photos and everything is appeared i want this page automaticaly printed without the user to press anything. is this possible?
 
<Body onload=&quot;window.print&quot;> Water is not bad as long as it stays out human body ;-)
 
Try :
Code:
<Body onload=&quot;window.print&quot; onBeforePrint=&quot;alert(&quot;printing...&quot;);'>

And tell me if you see the message. Water is not bad as long as it stays out human body ;-)
 
doesnt work...

i found this and i think its working ok.. thanx for the help though



<body onload=PrintAndClose();>
<Script Language=JavaScript>

function PrintAndClose(){

window.print(); //Invoke the windows print dialog
window.close(); //Close the window
}

</Script>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top