Closing a different window

Discussion in 'Javascript' started by Chris Hall, Oct 12, 2004.

  1. Chris Hall

    Chris Hall Guest

    Hi,

    I am using javascript and am trying to close another browser window from it.
    The browser window I am trying to close is the window that opened the other
    wondow.

    I have tried using the following code but it does not seem to do anything .

    window.opener.close();

    any other ideas anyone.

    Cheer

    Chris
    Chris Hall, Oct 12, 2004
    #1
    1. Advertising

  2. Chris Hall

    Randy Webb Guest

    Chris Hall wrote:
    > Hi,
    >
    > I am using javascript and am trying to close another browser window from it.
    > The browser window I am trying to close is the window that opened the other
    > wondow.


    "I open a window and want to close the original" seems to be a better
    explanation of your question.


    > I have tried using the following code but it does not seem to do anything .
    >
    > window.opener.close();


    Define "does not seem to do anything". It should raise a warning, throw
    an error, something. Even in IE.

    > any other ideas anyone.


    Yeah, but most of them are not fit to be posted to c.l.j.

    Stop trying to close my window. Its MINE. Leave it alone.

    And if you are testing in IE, yeah, I can close the window there.

    --
    Randy
    comp.lang.javascript FAQ - http://jibbering.com/faq
    Randy Webb, Oct 12, 2004
    #2
    1. Advertising

  3. Chris Hall

    kaeli Guest

    In article <ckh109$qpn$>,
    enlightened us with...
    > Hi,
    >
    > I am using javascript and am trying to close another browser window from it.
    > The browser window I am trying to close is the window that opened the other
    > wondow.
    >
    > I have tried using the following code but it does not seem to do anything .
    >
    > window.opener.close();
    >
    > any other ideas anyone.
    >


    I do hope this isn't for general internet use. Users of tabbed browsers will
    hate you forever.

    That said, from the opened window, do
    self.opener.close();
    (somewhere in the body after the page has finished loading for best results)

    If that doesn't work, tell us what browser it doesn't work from and post
    fully testable code. Also post an error messages you get, if any.

    --
    --
    ~kaeli~
    The man who fell into an upholstery machine is fully
    recovered.
    http://www.ipwebdesign.net/wildAtHeart
    http://www.ipwebdesign.net/kaelisSpace
    kaeli, Oct 12, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?U2lsZWVzaA==?=
    Replies:
    4
    Views:
    33,865
    =?Utf-8?B?U29sZWwgU29mdHdhcmU=?=
    Oct 14, 2004
  2. Patrick Olurotimi Ige

    Closing child window when opening a new Window

    Patrick Olurotimi Ige, Dec 14, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    427
    Patrick Olurotimi Ige
    Dec 14, 2004
  3. =?Utf-8?B?Vk1J?=

    Closing popup window when closing parent window?

    =?Utf-8?B?Vk1J?=, Feb 14, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    641
    Thomas Hansen
    Feb 15, 2007
  4. thomas
    Replies:
    0
    Views:
    214
    thomas
    Oct 23, 2003
  5. Jason
    Replies:
    1
    Views:
    164
    BinnyVA
    Oct 17, 2006
Loading...

Share This Page