I want to dynamically set the content of an iframe to that of an html document I have. It is in the form of a string in memory in javascript.
Then i want to print that iframe.
Ideas?
Yes.
var iframe = document.getElementByID("some ID");
iframe.contentDocument.write("HTML string");
iframe.contentWindow.print();
精彩评论