document.write is stopping me from printing
<p>When I create a document using javascript document.write</p>

<p>this is an iframe</p>

<p>then i call iframe.print()</p>

<p>nothing happens no error and no print dialog.</p>

<p>how can I print?</p>

<pre><code>MyFrame.document.write('&lt;html&gt;&lt;body&gt;'+HTMLText + '&lt;/body&gt;&lt;/html&gt;');
document.getElementById("IFramePrint").style.display = "inline";
MyFrame.focus();
MyFrame.print();
</code></pre>
