This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes window.print() not working with IE6.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "window.print() not working with IE6.0" Watch "window.print() not working with IE6.0" New topic
Author

window.print() not working with IE6.0

lubna kausar
Ranch Hand

Joined: May 06, 2006
Posts: 51
Hello,
In my portlet I need to generate an HTML and print it.
the new page I am generating using the following code.
function printMethod(){
MyWindow = window.open('','PrintWindow','toolbar=no,titlebar=no,width=800,height=800,scrollbars=yes');
MyWindow.document.write("<html><body bgcolor=#F1F8FE><table width=100%><tr><td style='font-size: 13px; font-family: Verdana,Arial,sans-serif; color:#003366; font-weight: bold'>"+document.getElementById('headerInfo').innerHTML+"</td><td align=right><a href='javascript:window.print();'>Print</a></td></tr></table>"+document.getElementById('requestSummaryDiv').innerHTML+"<br><br><center><a href='javascript:window.print();'>Print</a><center></body></html>")
}
It works fine with mozaila.
but when it comes to Internet Explorer
it blocks the content and doesnt even show the warning from where i can allow the blocked content...
so it does not even open the printer window in IE.
is there any solution to this?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: window.print() not working with IE6.0
 
It's not a secret anymore!