[thelist] check for existence of window by name?

Hardacker, Andrew Andrew.Hardacker at Compuware.com
Mon Mar 25 11:38:01 CST 2002


<snip>
Hi Andy, I have to wonder if you work in Farmington Hills, as I
worked for CPWR for three years. ;)

Will window.closed return true or false for a window that was
never opened?  if true, that's exactly what I need.  If false,
I'm afraid it's square one.  maybe something as simple as "if
exist(QT)"?  I'm new to the DOM, I'm afraid.
</snip>

Scott,

If the window was never instantiated, you can find out. As always, there are
several ways to do that, here's one:

if (typeof myWindow == "undefined" || myWindow == null)
  // open new instance

When the user closes the window, the js object still exists. This code:

if (myWindow.open)

will, I think, return true even if the window is closed because there is
still a window *object* which has an available method named "open".

I work in Cambridge, MA for a company that was acquired by Compuware about
18 months ago. Never been to the Farm.

Andy



The contents of this e-mail are intended for the named addressee only. It
contains information that may be confidential. Unless you are the named
addressee or an authorized designee, you may not copy or use it, or disclose
it to anyone else. If you received it in error please notify us immediately
and then destroy it.




More information about the thelist mailing list