This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Printer friendly page with javascript

 
raghavendra pola
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 .
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64683
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Put the print operation in the sub-page.

P.S. There are better ways to create printer-friendly pages. Look up CSS print media.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


should be



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

Eric
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic