WebSmart Code Samples
 

Adding a print button using JavaScript window.print()
and printing a static alternate document using the <LINK> tag


Description: This program demonstrates how to use the JavaScript window.print() function. This allows you to trigger a browser's print dialogue box from a button, such as the one below. It also demonstrates how to print a static alternate document using the <LINK> tag. Printing a static alternate page can be usefull when printing a more printer friendly page than the current page loaded in the browser. Example 38 is arguably a better technique in that it uses the same HTML file and uses style sheets for print media.


Click here to view step by step instructions on how this program was created


Click on the PRINT button below to launch your browser's Print Dialogue Box, and print this static document


  This example was created using WebSmart.

www.excelsystems.com