How can I close the window after the download is complete
<p>How can I close the window after the download is complete</p>

<pre><code>&lt;html&gt;
&lt;hide&gt;
  &lt;script&gt;
  $(function(){
   $("a").attr({
        "onclick":"javascript:window.close()",
        "target":"open"
        });

     $("a").click(function(){
     $("span").html("redy");
 });
  });

  &lt;/script&gt;
&lt;/head&gt;

&lt;body&gt;

&lt;span&gt;&lt;/span&gt; &lt;br /&gt;
&lt;a href="http://google.com"&gt;google&lt;/a&gt;

&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>I want after that loads the page closes the window</p>

<p>But do not close the window</p>

<p>But only loads the page in a new window only</p>

<p>I want after the end of the download page, close the window</p>

<p>......................</p>

<p><strong>To illustrate more</strong></p>

<p>I want when you press the button  It opens a new page and after opening Closes the window</p>
