London SEO
London SEO

24
Oct

How to close a window in Firefox (javascript)

The close() won’t always work in Firefox – FF will only close a window with close() if a script opened the window.

So you have to pretend it did… ;)

Use:

<a xhref="javascript:window.open('','_parent','');window.close();">Close Window</a>


10 Comments »

  1. PLEASE NOTE: CHANGE xhref TO HREF. Damn wordpress!

    Comment by search engine optimiser — November 29, 2006 @ 12:21 pm

  2. thanx

    Comment by Manpreet — September 3, 2007 @ 6:22 pm

  3. the solution does not work with FF 2.0.0.5. any idea ?

    Comment by nettellect — March 5, 2008 @ 7:05 am

  4. hi.. Your script does not close firefox 2.0. Please provide if any solution

    Comment by Sakthi — April 10, 2008 @ 9:38 pm

  5. does not work at all.

    Comment by s — June 20, 2008 @ 11:48 am

  6. I think your solution works only for FF version less than 2.0

    Comment by zer01 — August 5, 2009 @ 1:33 am

  7. Hi! I was surfing and found your blog post… nice! I love your blog. :) Cheers! Sandra. R.

    Comment by sandrar — September 10, 2009 @ 4:08 pm

  8. i’m not really sure what i’m doing wrong…
    i’m new to javascript
    when i put your script, as well as:

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

    into my blog, i want it to close my blog (or window/tab) completely

    any idea how to help me?

    Comment by icecreamiie — September 12, 2009 @ 12:10 am

  9. Sign: tpmnp Hello!!! axkwc and 3491yzquwckzgb and 6553 : Sorry, what did you mean?? A??

    Comment by emma watson sex — October 24, 2009 @ 6:26 am

  10. the script doesn’t work..!

    Comment by ipands — February 6, 2010 @ 10:25 pm

RSS feed for comments on this post. TrackBack URL

Leave a comment

Privacy Policy Terms and conditions of use of this site