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?

Xander
  • 9,069
  • 14
  • 70
  • 129

1 Answers1

0

Yes.

var iframe = document.getElementByID("some ID");
iframe.contentDocument.write("HTML string");
iframe.contentWindow.print();
SLaks
  • 868,454
  • 176
  • 1,908
  • 1,964