0

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?

zachary
  • 8,825
  • 13
  • 66
  • 123

1 Answers1

0

Yes.

var iframe = document.getElementByID("some ID");
iframe.contentDocument.write("HTML string");
iframe.contentWindow.print();
SLaks
  • 837,282
  • 173
  • 1,862
  • 1,933