aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Printer friendly page with javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Printer friendly page with javascript" Watch "Printer friendly page with javascript" New topic
Author

Printer friendly page with javascript

raghavendra pola
Greenhorn

Joined: Jan 18, 2007
Posts: 11
Hi guys ,
I have following page to display the printer friendly page of a current page using javascript

the following is the javascript



The problem is that after displaying the printer frriendly page , the focus is shifting back to main window from print friendly window.

So when window.print happens , it is printing the main window instead of printing the printer friendly window.

Can somebody please help me with this .


perfection is making best effort within constraints of space ,time and resources
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61437
    
  67

Put the print operation in the sub-page.

P.S. There are better ways to create printer-friendly pages. Look up CSS print media.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6


should be



You really do not need to use JavaScript, you can learn about CSS Print Media

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Printer friendly page with javascript