aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes How to include css in new window using javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "How to include css in new window using javascript" Watch "How to include css in new window using javascript" New topic
Author

How to include css in new window using javascript

Sahana Hegde
Ranch Hand

Joined: Jan 27, 2008
Posts: 67
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

Joined: Nov 08, 2001
Posts: 15376
    
    6
Try an absolute URL and see if it works.

Eric
Sahana Hegde
Ranch Hand

Joined: Jan 27, 2008
Posts: 67
Thank you for the reply. I tried that too. Its not working only in IE.
Its working fine in Mozilla.
Sahana Hegde
Ranch Hand

Joined: Jan 27, 2008
Posts: 67
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 ]
 
 
subject: How to include css in new window using javascript