title: Trying to reopen closed popup window
body: <p>I can't understand what is the reason that makes these 2 scripts written in javascript behave in different ways.</p>
  
  <p>Script 1</p>
  
  <pre><code>var w;
  function f1() {
      w = window.open("pg1.html","wind","left=0,top=0,width=480,height=480");
  }
  function f2() {
      w.close();
  }
  function f3() {
      w.open("pg1.html","wind","left=0,top=0,width=480,height=480");
  }
  </code></pre>
  
  <p>Script 2</p>
  
  <pre><code>function f() {
      var w = window.open("pg1.html","wind","left=0,top=0,width=480,height=480");
      w.close();
      w.open("pg1.html","wind","left=0,top=0,width=480,height=480");
  }
  </code></pre>
  
  <p>In case of script 1, if i execute <code>function f1()</code>, then <code>f2()</code> (as you can see <code>f1()</code> creates new window object and assigns the reference to that object to variable <code>w</code>, <code>f2()</code> closes window object created by <code>f1()</code>) and try to execute function <code>f3()</code> afterwards, closed popup window (<code>w</code>) doesn't open and in Firefox 19 I get error:</p>
  
  <blockquote>
    <p>Error: NS_ERROR_NOT_AVAILABLE: Component returned failure code:
    0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIDOMJSWindow.open],</p>
  </blockquote>
  
  <p>In IE8 I get error:</p>
  
  <blockquote>
    <p>The object invoked has disconnected from its clients,</p>
  </blockquote>
  
  <p>In Chrome 25 I get no errors.</p>
  
  <p>Execution of script 2 (<code>function f()</code> that creates new window object, assigns the reference to that object to variable <code>w</code>, closes created window and then tries to reopen it) doesn't cause any errors in browsers, but in Firefox  <code>f()</code> makes closed popup window reopen, while in IE and Chrome the popup window (<code>w</code>) remains closed.</p>
  
  <p>Could You please try these two scripts and help me to understand the reason of such strange behavior?</p>