Results 1 to 9 of 9

Thread: window.close() is not working in FF

  1. #1
    Join Date
    Apr 2008
    Posts
    15
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Smile window.close() is not working in FF

    Hi,
    Its seems v.silly question but I cant close Firefox window using
    javascript:window.close();
    command, anyone have a solution for this please advise...
    thanks in advance
    regards
    Kazmi~

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Either one of these should work:
    Code:
    <button onClick="window.close()">Close Window</button>
    Code:
    <a href="javascript:window.close()">Close Window</button>
    Jeremy | jfein.net

  3. #3
    Join Date
    Apr 2008
    Posts
    15
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Thx Nile but all these commands are working only with IE but not with Firefox. I've tried all these
    1- <a href="javascript:self.close();">Close </a>
    2- <a href="javascript:window.close();">Close </a>
    but no luck........

  4. #4
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    It must be your settings, make a page(html) and put this in:
    Code:
    <script>
    alert('Javascript is enabled');
    </script>
    <noscript>Javascript is disabled</noscript>
    Tell me the output.
    Jeremy | jfein.net

  5. #5
    Join Date
    Apr 2008
    Posts
    15
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Lol strange..... Javascript is enabled as well nothing wrong with browser as its newly downloaded and being busy on lots on testing and development and all function perfect.....let me search as well......... thx for your time, did you test this on your firefox ?

  6. #6
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Yes, I did any it worked what version do you have as I have FF 2.0.0.14
    Jeremy | jfein.net

  7. #7
    Join Date
    Apr 2008
    Posts
    15
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Yup same version, i even upload the script to test, cause i feel like it might be cause im local (although thats sounds stupid) ......

  8. #8
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Hmm, try downloading it again, although I don't think it will work, but if you contact Mozilla, they'll probably tell you the same thing. So reinstall it, if it still doesn't work contact them.
    Jeremy | jfein.net

  9. #9
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    No, there's no problem in FF, the problem is in Javascript itself

    In FF, window.close() will never close, not unless you opened that window through window.open method

    For further reading:
    http://developer.mozilla.org/en/docs/DOM:window.close

    Hope that helps
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •