title: Java script function suddenly stopped working in Chrome
body: <p>I am developing an application with ASP.net and VB.net. In that application i have written this simple javascript function in the popup window in order to refresh the parent window when the popup is closed.</p>
  
  <pre><code> function RefreshParent() {
           if (window.opener != null &amp;&amp; !window.opener.closed) {
               window.opener.location.reload();
                }
           }
     window.onbeforeunload = RefreshParent;
  </code></pre>
  
  <p>This was working fine. But suddenly it stopped working. Its still working on Firefox and internet explorer. </p>
  
  <p><strong>its not just a problem in my PC. I am getting this problem from every user who is using chrome to access the application.</strong> </p>
  
  <p>The function was working fine. Its just stopped working suddenly. And I can assure that  there was no such changes been made which might cause this happen. Its still working on Firefox and IE</p>
  
  <p><strong>But i Have tried the following to see if the problem is related with chrome settings</strong></p>
  
  <p>to see if the javascript is enable or not I double checked the content settings section in advance setting of the browser. Allow all site to run Javascript option is selected. </p>
  
  <p>And I have also re installed chrome. </p>
  
  <p>According to the suggestion of Jeremy I have added two alerts in the javascript function to see if the function is accessed or not.</p>
  
  <pre><code>     function RefreshParent() {
           alert("Accessed the function!");
           if (window.opener != null &amp;&amp; !window.opener.closed) {
               window.opener.location.reload();
                }
        }
        alert("refreshed parent window!");
        window.onbeforeunload = RefreshParent;
  </code></pre>
  
  <p>I can only see the 2nd alert. But this alert comes when i click to open the popup. </p>
  
  <p>Also when I add this two alert the refreshing function also stops working in firefox (I did not checked in ie with the alert on.)</p>
  
  <p>How to solve the problem</p>