um, you should know that window.print() only works with ie <br>(not sure what versions tho).<br><br>try this:<br><br><script language="javascript"><br>function myPrinter(){<br>if (window.print()) window.print<br>else {<br>alert("Your browser does not support automatic printing. Please select \"Print\" from the file menu"}<br>}<br></script><br><br>with that code snipit, all you need to do to print a page is call the function myPrinter. like this: myPrinter();<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.
Here is something that I fount in the net and that works for me.<br><br>//==========================================================<br>function printPG (){<br> if (document.all){<br> document.body.insertAdjacentHTML("beforeEnd",<br> "<object id=\"printWB\" width=0 height=0 classid=\"clsid:8856F961-340A-11D0-A96B-00C04FD705A2\"></object>"<br> execScript("on error resume next: printWB.ExecWB 6, 1", "VBScript"<br> printWB.outerHTML = "";<br> }<br> else{<br> window.print();<br> }<br>} <p>IvanP<br><a href=mailto:ip@thehyper.net>ip@thehyper.net</a><br><a href= > </a><br>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.