Cross Browser Printing using iFrame in Javascript

Viewed 1545

I want to print using iFrame and javascript. Below are my sample codes for the same:

Javascript

 function printDiv(divP) {

            window.frames["print_frame"].document.body.innerHTML = $(divP).html();
            window.frames["print_frame"].window.focus();
            window.frames["print_frame"].window.print();
        }

HTML

<iframe name="print_frame" width="0" height="0" frameborder="0" src="about:blank">
        </iframe>

This Code is working in IE and Mozilla only. Other Browsers are printing White pages. I don't want to use the Media Queries. What could be the possible issue?

1 Answers
Related