this is some I am thinking about and an approach that I may take, have'nt
got to that stage yet but window.closed looks good

http://bytes.com/forum/thread91209.html

2008/7/3 Bruce MacKay <[EMAIL PROTECTED]>:

>  More searching has led me to a solution, and another question
>
>         $("a.openW").click(
>          function(e) {
>             var sTarget = this.href;
>             if (winRef && ! winRef.closed){
>                  winRef.focus();
>              }else {
>
                 winRef=window.open(sTarget);
            }
             // or do I mean stopProgation
             e.preventDefault();
         });

This code does the necessary check, but it won't move focus to the existing
opened window (that contains the help file).

What am I not doing correctly?

Thanks,

Bruce



At 01:11 p.m. 3/07/2008, you wrote:

Hello folks,

I can't find the answer I need in the archives (Nabble), so my question is
how do I check to see if a window exists before I open it?

When a user of my application clicks on a help link, I want the help file to
load into a new window.  I'm doing that via...

        $("a.openW").click(
         function() {
             window.open(this.href); return false;
         });

But I want to first make sure that a window containing the help file isn't
already open before a new one (another one) is opened.

Help/direction appreciated.

Thanks,

Bruce

Reply via email to