Closing a different window

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

    #1

    Closing a different window

    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.c lose();

    any other ideas anyone.

    Cheer

    Chris


  • Randy Webb

    #2
    Re: Closing a different window

    Chris Hall wrote:[color=blue]
    > 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.[/color]

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

    [color=blue]
    > I have tried using the following code but it does not seem to do anything .
    >
    > window.opener.c lose();[/color]

    Define "does not seem to do anything". It should raise a warning, throw
    an error, something. Even in IE.
    [color=blue]
    > any other ideas anyone.[/color]

    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.javas cript FAQ - http://jibbering.com/faq

    Comment

    • kaeli

      #3
      Re: Closing a different window

      In article <ckh109$qpn$1@h ercules.btinter net.com>, chrish@skwirel. com
      enlightened us with...[color=blue]
      > 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.c lose();
      >
      > any other ideas anyone.
      >[/color]

      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.clo se();
      (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.



      Comment

      Working...