Reputation: 11
The JavaScript function window.print
is working in IE7 and 8, but not in IE9. Can someone help to fix this?
Upvotes: 1
Views: 3710
Reputation: 1
you need to do few things.
Add a in the
close the document properly: mywindow.document.close();
do focus on the documnet: mywindow.focus();
then write the print code: mywindow.print();
exp:
var mywindow = window.open('', 'My Print Data', 'width=850,scrollbars=yes');
mywindow.document.write('<html><head><title>Print Page</title><meta http- equiv="X-UA-Compatible" content="IE8"/>');
..........
.........
.........
...........
mywindow.document.write('</div></body></html>');
mywindow.document.close();
mywindow.focus();
mywindow.print();
Upvotes: 0