Home > Javascript > Mozilla firefox JavaScript window.close() not working / does not work in firefox

Mozilla firefox JavaScript window.close() not working / does not work in firefox


We can use this code

<script>
function closeMe()
{
var win=window.open("","_self");
win.close();
}
</script>
<html>
<body>
<form>
<input type="button" name="Close"        
onclick="closeMe()" />
</form>
</body>
</html>

We can also write script like this

function winClose()
{
window.top.opener=null;
window.close();
}

or try this also

function closeWindow()
{
window.open('','_parent','');
window.close();
}

Hope this helps

Good Luck

Advertisements
Categories: Javascript
  1. Muhammad Irfan
    October 2, 2009 at 10:41 am

    Not working… Is there any way in Mozilla to close browser using java script method.

  2. kokers
    November 4, 2009 at 7:15 pm

    yep, same here… not working.

  3. Khudadad
    July 2, 2010 at 11:14 am

    Not Working

  1. April 12, 2009 at 6:51 am

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: