Create new window using jquery
<p>I'm working on a little project in JavaScript/jQuery. </p>

<p>In order to display results from a calculation done in javascript, I'd like to open a new window with some predefined content and modify this content in order to display the results: Im using code like this:</p>

<pre><code>var resultwindow = window.open('result.html')
var doc = $('body', resultwindow.document);
doc.append("&lt;p&gt;Result&lt;/p&gt;")
</code></pre>

<p>This is not working since the result document is not yet loaded when I append the content, so it is overwritten with the contents of 'result.html'.</p>

<p>I also tried</p>

<pre><code>$(resultwindow.document).ready(function() {
    // ... Fill result document here
})
</code></pre>

<p>and</p>

<pre><code>$(resultwindow.document).load(function() {
    // ... Fill result document here
})
</code></pre>

<p>but <code>ready()</code> works only on the current document (it is called immediately, if the current document is already loaded), and <code>load</code> doesn't get called at all.</p>

<p>Perhaps someone can point me to the right direction. Thanks in advance!</p>
