I had to make a few changes to do this in IE8 (not tested with other IE accessories)
1) document.frames [param] seems to take a number, not an ID
printIframe(0, 'print'); function printIframe(num, id) { var iframe = document.frames ? document.frames[num] : document.getElementById(id); var ifWin = iframe.contentWindow || iframe; ifWin.focus(); ifWin.printPage(); return false; }
2) I had a print dialog displayed when the page loads, and there was also a link to "Click here to start printing" (if it did not start automatically). To get it working, I had to add a focus () call
<script type="text/javascript"> $(function(){ printPage(); }); function printPage() { focus(); print(); } </script>
Yura Omelchuk Dec 07 2018-11-21T00: 00Z
source share