tags:

views:

28

answers:

1

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?

A: 

Yes.

var iframe = document.getElementByID("some ID");
iframe.contentDocument.write("HTML string");
iframe.contentWindow.print();
SLaks