Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to include css in new window using javascript

 
Sahana Hegde
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I am using this function to print out a part of the current page. It is getting the content correctly. However if I include the link to the stylesheet the window.print is not working. please help.


The above function works correctly in Mozilla but not IE.
Thanks
[ September 05, 2008: Message edited by: Sahana Hegde ]
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try an absolute URL and see if it works.

Eric
 
Sahana Hegde
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for the reply. I tried that too. Its not working only in IE.
Its working fine in Mozilla.
 
Sahana Hegde
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I kept trying to make it work and noticed that it is printing if I remove the link to the css file in the new window. It is just printing a blank page with header and footer if I include the css. I tried hard coding the css information in the js file, but still prints a blank page. any ideas?

[ September 08, 2008: Message edited by: Sahana Hegde ]
[ September 08, 2008: Message edited by: Sahana Hegde ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic