[thelist] Testing for the existence of a named spawned window

The Optimizer chrism at puffofsmoke.net
Thu Oct 4 10:05:58 CDT 2001


Thanks for the assistance, guys. What I'm actually trying to do is create a
faux-modal window. Hence, if focus is applied to the opener and it detects
that the popup window exists, then it applies focus to the popup, making it
difficult to do anything with the opener until the popup is closed.

> <snip>
> somebody tell me how in javascript to test for the existence of a named
> >window that has been spawned from the window that is testing?
>
> Open it like this
>
> var newwin = window.open(etc)
>
> Then check
>
> if (newwin && !newwin.closed)
> {
>   window is open
> }
> </snip>
>
> I think I know where this is going...
> I have a page where we link to several other websites, so for each link I
> have something like this
> <a href="www.othersite1.com" target="new1">daLink</a><br>
> <a href="www.othersite2.com" target="new2">daLink</a><br>
> <a href="www.othersite3.com" target="new3">daLink</a><br>
>
> The marketing people didn't want people "leaving" our site so
> they made the
> popUp mandatory.  Anyways, I'm wondering if anyone has already written the
> code to
> 1) detect if the window is already open
> 2) if it is, bring it to the front
>
> Thanks,
> Ron
>
>
> ---------------------------------------
> For unsubscribe and other options, including
> the Tip Harvester and archive of TheList go to:
> http://lists.evolt.org Workers of the Web, evolt !
>





More information about the thelist mailing list