Parent window is getting closed on refresh
<p>My requirement is that on close of parent window child windows should also close. But now the problem is that even when I refresh my parent window the windows get closed. I dont want that refresh to close the windows. My code is </p>

<pre><code>            function closeEditorWarning(){

     for (var i=0;i&lt;childWindow.length;i++) {
           if (childWindow[i] &amp;&amp; !childWindow[i].closed)    childWindow[i].close();
     }
    self.close();
     }

          window.onbeforeunload = closeEditorWarning;
</code></pre>
