title: Overriding window.close in Javascript
body: <p>I am trying to override <code>window.close()</code> Method in <code>javascript</code>. Here is my code.</p>
  
  <pre><code> (function () {
      var _close = window.close;                  
      window.close = function () {
          window.opener.alert("test");
          _close();                             
      };
  })();
  </code></pre>
  
  <p>I am trying to bind this code to new window and execute the inner code when the new window is closed. 
  Is is possible to override <code>window.close</code> like this ?</p>