
Vader |
Hi Omar,
There are a few ways to go about setting up a JavaScript print option all of which use the window.print() function. The print function opens the print dialog box as you mentioned and gives the user the choice of printer and options.
JavaScript Print via text link
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
<a href="javascript:window.print()">Print Me!</a>
JavaScript Print via image link
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
<a href="javascript:window.print()"><img src="/images/print_button.gif" /></a>
Automatically calling the print function
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
In the body of your page you can add the print function to your onLoad event. This is typically used when a user options a printer friendly version of your page as their action would hint their intention to print.
<BODY onload="window.print()">
V.
Monday, 28th September 2009
| Votes: |
|
19 |
|
12 |
|