[thelist] closing a non-child window in Javascript

.jeff jeff at members.evolt.org
Tue Jan 21 21:42:01 CST 2003


first off, please don't reply to someone else's post in order to start a new
thread on thelist.  make it a point to start a new message and send it to
thelist at lists.evolt.org.

second, be sure to trim all the unnecessary bits from the messages you send.
this includes headers, footers, signatures, and any other bits that aren't
relevant to your response to the message.

> From: margueriteh
> Does anyone know if it is possible to close a window
> from another window in which there is no parent/child
> relationship?
> I am attempting to do this, but I get an error message
> stating that the window I am trying to close is
> undefined. (It works fine when I close it from its
> parent window)
> Any ideas on this? Any help you could give me would be
> greatly appreciated!

a couple of questions:

1)  is this window you're trying to close created with
    javascript?  if so:

    a) is the script that created it from the same
       domain as the script you're using to try to
       close it?

    b) was the creation of the window you're trying to
       close created with an object reference?  ie,
       was it assigned to a variable you can access?

    c) is the document that opened the window you're
       trying to close still available in the browser
       window or has the user somehow already
       navigated away from it?

this window grabbing script might prove helpful.


good luck,


jeff at members.evolt.org

More information about the thelist mailing list