« URL Redirect | Main | Test for New Entry »
March 02, 2005
Automatic 'Print this page'
If you want to provide a way for the user to print the current page, include this little javascript snippet.
Of course, they could always just select file > print by themselves... but will they? A good combination is to use this in conjunction with the Javascript - Bookmark this page that is found elsewhere on this site.
This print function is also very useful when you are using frames. Since the browser doesn't always know which of the frames you want printed, and sometimes will only print the top frame you can use this to only send the data that the user will want printed. As long as you think you can predict WHICH of the frames they will want.
Since the javascript exists inside the frame, that's the one that'll be sent to the print que.
How do you do it? Put the following code somewhere on your page, again usually in the upper right.
< a href="#" onClick="window.print()" >Print this page< /a >
Try it next time you need or want to provide another feature on your site. As always though my advice is; don't overuse it!
Hope this helps.
Posted by kla3 at March 2, 2005 02:36 PM *Posted to Tutorial Category
Trackback Pings
TrackBack URL for this entry:
http://blog.case.edu/test/kevin/mt-tb.cgi/555
Comments
bfpc zpra ikqwuc mlhfricke pdzngmrc dfgnhjcxi sglja
Posted by: bugjaf xkzcp at January 1, 2007 11:10 AM