Yasserzaid’s Weblog

April 11, 2009

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

Filed under: Javascript — yasserzaid @ 7:10 pm

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

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

Hope this helps

Good Luck

3 Comments »

  1. [...] bookmarks tagged mozilla Mozilla firefox JavaScript window.close() not work… saved by 3 others     LadySubaru59007 bookmarked on 04/12/09 | [...]

    Pingback by Pages tagged "mozilla" — April 12, 2009 @ 6:51 am

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

    Comment by Muhammad Irfan — October 2, 2009 @ 10:41 am

  3. yep, same here… not working.

    Comment by kokers — November 4, 2009 @ 7:15 pm


RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.