window.open create reference to the name based
<p>This way I get the reference to the open window:</p>

<pre><code>var refWin = window.open("mypage1", "name_mypage");
</code></pre>

<p>if you want to close the window, I close with:</p>

<pre><code>refWin.close();
</code></pre>

<p>if I do a screen refresh (F5) and run the same line, it opens in the same window, because I put the same name.</p>

<pre><code>var refWin = window.open("mypage2", "name_mypage");
</code></pre>

<p>but with different reference (refWin).</p>

<p>Question: how I can make reference to the window based on the name?, I need to close the window before opening, with the same name.</p>

<p>do something like:</p>

<pre><code>var refWin = window.open("about:blank", "name_mypage");
refWin.close();
refWin = window.open("mypage2", "name_mypage");
</code></pre>

<p>but without having to be a blank window for reference.</p>

<p>thanks</p>
