471,594 Members | 2,618 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,594 software developers and data experts.

Find any open windows from different parents

J.R
I'm trying to determine if a named child window has been opened before
opening a new one, however my challenge is that the child window may have
been opened from a parent that no longer exists, therefore there is no
access to the child window handle. Any ideas?

Thanks All.
Jul 20 '05 #1
3 14010
"J.R" wrote:
I'm trying to determine if a named child window has been opened before
opening a new one, however my challenge is that the child window may have
been opened from a parent that no longer exists, therefore there is no
access to the child window handle. Any ideas?

Thanks All.


Just call window.open() with the same 2nd parameter (window name) as before.
If the window is currently open, the content will be directed to it, if it's
not open, it will be opened and the content loaded.

--
| Grant Wagner <gw*****@agricoreunited.com>

* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/...ce/frames.html

* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/a...ence_entry.asp

* Netscape 6/7 DOM Reference available at:
* http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 6/7 and Mozilla
* http://www.mozilla.org/docs/web-deve...upgrade_2.html
Jul 20 '05 #2
J.R
Thank you for your reply Grant.

Yes, it does replace the named window using the method you suggested,
however when I check my window object reference opened by the now non
existent parent with the following code
WinObj = window.open(
theUrl,winName,'scrollbars=no,resizable=no,top=0,l eft=0,width=740,height=500
' );

WinObj does not any longer contain the windows handle, at least not
recognized by the new parent when I check as follows,

if(window.WinObj == null)

and what I need to do is intercept this and respond to the user.

Any thoughts?

Thanks again, John.

"Grant Wagner" <gw*****@agricoreunited.com> wrote in message
news:3F***************@agricoreunited.com...
"J.R" wrote:
I'm trying to determine if a named child window has been opened before
opening a new one, however my challenge is that the child window may have been opened from a parent that no longer exists, therefore there is no
access to the child window handle. Any ideas?

Thanks All.
Just call window.open() with the same 2nd parameter (window name) as

before. If the window is currently open, the content will be directed to it, if it's not open, it will be opened and the content loaded.

--
| Grant Wagner <gw*****@agricoreunited.com>

* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/...ce/frames.html
* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/a...ence_entry.asp
* Netscape 6/7 DOM Reference available at:
* http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 6/7 and Mozilla
* http://www.mozilla.org/docs/web-deve...upgrade_2.html

Jul 20 '05 #3
Well, if page1.html calls WinObj = window.open(..., "TheName", ...), then the browser
containing page1.html is closed, of course your window reference will be lost.

So the solution is to do WinObj = window.open(..., "TheName", ...) on page2.html. You
will now have a new reference to the same window you opened before (or if the window
didn't exist, it will be opened and you will have a reference to that newly opened
window).

"J.R" wrote:
Thank you for your reply Grant.

Yes, it does replace the named window using the method you suggested,
however when I check my window object reference opened by the now non
existent parent with the following code
WinObj = window.open(
theUrl,winName,'scrollbars=no,resizable=no,top=0,l eft=0,width=740,height=500
' );

WinObj does not any longer contain the windows handle, at least not
recognized by the new parent when I check as follows,

if(window.WinObj == null)

and what I need to do is intercept this and respond to the user.

Any thoughts?

Thanks again, John.

"Grant Wagner" <gw*****@agricoreunited.com> wrote in message
news:3F***************@agricoreunited.com...
"J.R" wrote:
I'm trying to determine if a named child window has been opened before
opening a new one, however my challenge is that the child window may have been opened from a parent that no longer exists, therefore there is no
access to the child window handle. Any ideas?

Thanks All.


Just call window.open() with the same 2nd parameter (window name) as

before.
If the window is currently open, the content will be directed to it, if

it's
not open, it will be opened and the content loaded.


--
| Grant Wagner <gw*****@agricoreunited.com>

* Client-side Javascript and Netscape 4 DOM Reference available at:
* http://devedge.netscape.com/library/...ce/frames.html
* Internet Explorer DOM Reference available at:
* http://msdn.microsoft.com/workshop/a...ence_entry.asp
* Netscape 6/7 DOM Reference available at:
* http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 7 / Mozilla
* http://www.mozilla.org/docs/web-deve...upgrade_2.html
Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by srussell705 | last post: by
reply views Thread by =?Utf-8?B?QWxoYW1icmEgRWlkb3MgRGVzYXJyb2xsbw==?= | last post: by
reply views Thread by =?Utf-8?B?QWxoYW1icmEgRWlkb3MgRGVzYXJyb2xsbw==?= | last post: by
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by Anwar ali | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.