Click to See Complete Forum and Search --> : Detecting Any/All Open Windows


GingerNutter
03-24-2004, 05:44 AM
Is there a way of finding all open windows created by the parent window no matter what page(within the site) the parent window is on.

For Example:
What if ParentWindow (on page1.htm) opens a NewWindow then moves on to a page2.htm.

How does page2.htm detect if page1.htm has opened up a window or not?

gil davis
03-24-2004, 07:02 AM
The only way you can track windows from pages that did not open them is by using the window's NAME attribute. If you use
theWindow = window.open("", windowName);
(where windowName contains a string that represents the name of the window), then if a window with that name exists, you will get a pointer to it. If it does not already exist, an empty window is created that you can throw away.

You have to know the name. There is no "list of windows" in the browser that you can access. That would be a rather large security hole.

GingerNutter
03-24-2004, 07:16 AM
what do you mean by then if a window with that name exists, you will get a pointer to it

Doesn't it just reload that window again?

gil davis
03-24-2004, 02:15 PM
No, it does not reload the window, because I did not specify any URL in the window.open(). See http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/open_0.asp for more information. There is something special about it.