Thursday, August 27, 2009

The text to be printed is contained in a div



The id of the div is passed to the function.

Click to print div 1

On clicking the link the following sequence of events happens.

1. A new window is opened
2. The contents of the div are dynamically written to the new window
3. Data is sent to the printer
4. The new window is automatically closed (IE only)

Other areas of a page can be printed simply by defining another div and link



Click to print div 2


start the javascrpt tab


close the javascrpt tab

No comments:

Post a Comment