Is it possible to close a browser window using javascript?
<p>I need to close the browser window using the java script.</p>

<p>I have tried using window.close but it is not working. </p>

<p>I have also googled and checked stack overflow for any similar posts. I have also gone through following link but in vain.</p>

<p><a href="http://stackoverflow.com/questions/3644341/is-it-possible-to-close-browser-window-from-javascript">Is it possible to close browser window from JavaScript?</a></p>

<p>What I am trying to do is load a page and on load of the page call a java script method which does window.close</p>

<p>Below is the code</p>

<pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"&gt;
&lt;html&gt;
&lt;head&gt;
&lt;script&gt;
function closeBrowser(){
    window.close();
}
&lt;/script&gt;
&lt;/head&gt;
 &lt;body onload="closeBrowser();"&gt;
 &lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>It is properly working in IE8 though. Its not working in the fire fox. </p>

<p>And even in IE it gives the alert prompt before actually closing the browser. Can we avoid the alert in IE?</p>

<p>Why it does not work in fire fox?</p>
