window.close()

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Obscurr

    window.close()

    hi,

    I'm wondering how I can close a window that is not active at the
    moment using javascript?
    example : I have two Internet Explorer windows opened, and I want to
    close the one I'm not currently using. Maybe some form of
    window.close()?

    obscurr
  • Lasse Reichstein Nielsen

    #2
    Re: window.close()

    obscurr@hotmail .com (Obscurr) writes:
    [color=blue]
    > I'm wondering how I can close a window that is not active at the
    > moment using javascript?
    > example : I have two Internet Explorer windows opened, and I want to
    > close the one I'm not currently using. Maybe some form of
    > window.close()?[/color]

    You need a reference to the window object of the other window.

    If you have opened it yourself, you should still have the reference
    returned by window.open. If it was opened by some other page and was
    given a name, then you can use window.open with the same name, to get
    a new reference to the window.

    If the window wasn't opened by Javascript, then you can't/shouldn't
    close it.

    /L
    --
    Lasse Reichstein Nielsen - lrn@hotpop.com
    Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit. html>
    'Faith without judgement merely degrades the spirit divine.'

    Comment

    Working...