![]() |
[html] Print script
I have 2 option of getting a particular webpage to be printed. 1 way is automatically and the other way is letting the user click on a button to print.
I don't want to use automaticallly since I want to let the user view the page before printing it. So, I'm considering using the following script for manual print button Code:
<SCRIPT LANGUAGE=JavaScript> If not, is there a way for me to program a webpage using either html or jsp to print information from another page? |
you could throw a dialog box to remind them to print the page.
function printPage() { if (window.print) { agree = confirm('This page contains really cool information that \nwe recommend you print a copy of at this time. \n\nOK to print now?'); if (agree) window.print(); } } you could then put a link to a printer friendly version of the page and onload execute the printPage() function. |
You can also eliminate the print button using css.
In css, a little used feature is to have different stylesheets for different media types. So, for example, in the print media type, you could set the print button to not display. Simple, easy, and doesn't require any client-side (or server-side) scripting. |
Quote:
|
Quote:
|
All times are GMT -8. The time now is 10:31 AM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2
© 2002-2012 Tilted Forum Project