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

Disable print.

Status
Not open for further replies.

teky

Programmer
Mar 24, 2000
55
US
Is there any way I can disable printing when the user is browsing my site. <p> <br><a href=mailto: > </a><br><a href= > </a><br>
 
I finally thought of something:<br><br>function printing(){return false}<br>if (window.print()){window.onPrint=printing}<br><br>not sure if the onPrint really exists, but most likly.<br><br> <p>theEclipse<br><a href=mailto:eclipse_web@hotmail.com>eclipse_web@hotmail.com</a><br><a href=robacarp.webjump.com>robacarp.webjump.com</a><br>**-Trying to build a documentation of a Javascript DOM, crossbrowser, of course. E-mail me if you know of any little known events and/or methods, etc.
 
Try this javascript &quot;full window open&quot; without menu buttons just a title bar for any specific page that you don't want people printing. You can change the window height/width.<br><br>&lt;script language=&quot;JavaScript&quot;&gt;<br>&nbsp;&nbsp;&lt;!--<br>&nbsp;&nbsp;function openWindow(myLink,windowName)<br>&nbsp;&nbsp;{<br>&nbsp;&nbsp;if(! window.focus)return;<br>&nbsp;&nbsp;var myWin=window.open(&quot;&quot;,windowName,&quot;height=550,width=650,dependent=yes,scrollbars=no&quot;);<br>&nbsp;&nbsp;myWin.focus();<br>&nbsp;&nbsp;myLink.target=windowName;<br>&nbsp;&nbsp;}<br>&nbsp;&nbsp;//--&gt;<br>&lt;/script&gt;<br>&lt;/head&gt;<br><br><br>&lt;a href=&quot;file.htm&quot; onClick=&quot;openWindow(this,'thoughts')&quot;&gt;Text Link&lt;/a&gt;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top