close() funtion compatible for all browser

Discussion in 'JavaScript' started by yogendramishra, Aug 29, 2007.

  1. #1
    Hello friends,
    I am looking for such script or function which should be compatible with all browser. The function i have is only working with IE,Opera, and safari not in others. So pls help me to find out the script which should compatible with all browser.
    yogendra
     
    yogendramishra, Aug 29, 2007 IP
  2. gibex

    gibex Active Member

    Messages:
    1,060
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    95
    #2
    close() of what? can you be more specific?
     
    gibex, Aug 29, 2007 IP
  3. Coder

    Coder Banned

    Messages:
    311
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #3
    He is talking about javascipt's window.close() function.

    Yes it is compatible with all the browsers.
     
    Coder, Aug 30, 2007 IP
  4. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #4
    Note that close() won't close the parent window. And in Firefox (maybe other browsers too) it will only close child windows if there are no other tabs open in it.
     
    nico_swd, Aug 30, 2007 IP
  5. garazy

    garazy Peon

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    nico_swd is completely right on this. You have to try and think from a security perspective of the user. If they open their browser, you can't close it for them. Simple as that. However, if they click on a link on your website that opens another window, such as a modal style box, then you will be able to close it as they have trusted your site to allow the window to open in the first place.
     
    garazy, Aug 31, 2007 IP