More searching has led me to a solution, and another question

        $("a.openW").click(
         function() {
            var sTarget = this.href;
            if (!winRef.open){
                 winRef=window.open(sTarget);
                 return false;
             }else {
                 winRef.focus();
                 return false;
            }
         });

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