471,075 Members | 801 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

window handle state {...}

I have a parent/child relationship between two windows. The parent
spawns the child using something like this.

windowHandle = window.open("child.aspx","child");

the problem is that if the child window closes then the windowHandle
object is left in an orphaned state. It does't equate to null and I'm
not sure how to check and see if the window still exists. The child
does notify the parent window through the window.opener object when it
closes but this does not work in EVERY case.

I'm looking for something like "if isnothing(windowHandle)"

thanks
will

Jul 23 '05 #1
3 2609
VK
In your child.aspx :
<body onUnload="self.opener='null';"

Would be nice to have self-updating window-refs, but it would possibly
compromise the unter-domain security.
Jul 23 '05 #2

VK,

Thanks for the quick response. I am currently performing some similar
code in the onload event but the problem is that if the child page
reloads because of an autopost back of a drop down control then the
onunload event fires and I don't want to seperate the parent and the
child at that point, only when the child window closes. This is the
problem I'm trying to work around. I just wish there was an event that
signals the window closing and not just unload the html.
will
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 23 '05 #3
"Will" <Wi********@Yahoo.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
I have a parent/child relationship between two windows. The parent
spawns the child using something like this.

windowHandle = window.open("child.aspx","child");

the problem is that if the child window closes then the windowHandle
object is left in an orphaned state. It does't equate to null and I'm
not sure how to check and see if the window still exists. The child
does notify the parent window through the window.opener object when it
closes but this does not work in EVERY case.

I'm looking for something like "if isnothing(windowHandle)"


<url: http://jibbering.com/faq/#FAQ4_10 />

windowHandle is not in an "orphaned" state. It's -closed- property is
set to true. You can test for that.

--
Grant Wagner <gw*****@agricoreunited.com>
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by danny | last post: by
6 posts views Thread by news.versatel.de | last post: by
8 posts views Thread by Luke Matuszewski | last post: by
5 posts views Thread by Sommer.pde | 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.