Question: self.close() is working fine in IE but not in Mozilla. Does anyone know what is the issue and how can I solve it?

Answer: 
Did you open the window using `window.open`? [According to the docs on window.close](https://developer.mozilla.org/En/DOM/Window.close):

> 
> This method is only allowed to be called for windows that were opened by a script using the window.open method. If the window was not opened by a script, the following error appears in the JavaScript Console: Scripts may not close windows that were not opened by script. 
> 
> 
>
See my answer to [this other question](https://stackoverflow.com/questions/375406/375640#375640). You should be able to easily adapt it from ASP.NET to plain HTML.

Basically, since mozilla will only let you close a window that was opened by js, you can open a new window and target \_self:

```
window.open('close.html', '_self', null);

```

now your window was opened by js and you can close it with js! :)
close.html:

```
<html><head>
 <title></title>
 <script language="javascript" type="text/javascript">
     var redirectTimerId = 0;
     function closeWindow()
     {
         window.opener = top;
         redirectTimerId = window.setTimeout('redirect()', 2000);
         window.close(); 
     }

     function stopRedirect()
     {
         window.clearTimeout(redirectTimerId);
     }

     function redirect()
     {
         window.location = 'default.aspx';
     }
 </script>
 </head>
 <body onload="closeWindow()" onunload="stopRedirect()" style="">
     <center><h1>Please Wait...</h1></center>
 </body></html>

```