Skip to main content
Jan 27, 2010 1:13 PM UTC
Question

Want link to re-use a window if window exists, else to open a new window

Hi,

I have a reference topic with a large number of bookmarked entries. (This is for good an sufficient reasons.)

Other topics have links to bookmarked locations on this reference topic.

If the reference topic is not already open, these links in the other topics should open the reference topic in a new window, but if the reference topic is already displayed these links should re-use the opened display.

Can anyone help?

Thanks and regards,

Peter

This topic is closed to new replies. Start a new post to keep the conversation going.

3 replies

Willam van Weelden
Inspiring
Jan 27, 2010 1:58 PM UTC

Hi,

You need to create a JavaScript solution for this, but I wonder whether it will work if you use the script on several pages. See:

http://bytes.com/topic/javascript/answers/469409-check-if-window-open

http://www.webreference.com/js/tutorial1/exist.html

You can also use custom size/auto size popup to call your reference topic. This is probably the quickest and easiest solution.

Greet,

Willam

This e-mail is personal. For our full disclaimer, please visit www.centric.eu/disclaimer.

Translate
Willam van Weelden
Inspiring
Jan 27, 2010 2:59 PM UTC

Hi,

It just occured to me that I have a simple script that does just what you want:

function SupportShow()
{
          Support=window.open('ondersteuningssite.htm','Title','status=0,toolbar=0,location=0,menubar=0,resizable=1,scrollbars=1,width=1024,height=600')
          Support.focus()
          return true;
}

The hyperlink is: <A href="javascript:void(0);" onClick="SupportShow()" >123</a>

If you want to give the bookmark in a link, modify the script like this:

function SupportShow(sURL)

{

          Support=window.open(sURL,'Title','status=0,toolbar=0,location=0,menubar=0,resizable=1,scrollbars=1,width=1024,height=600')
           Support.focus()
           return true;
}

The hyperlink will then be: <a href="javascript:void(0);" onClick="SupportShow('mypage.htm#bookmark')">123</a>

Greet,

Willam

Translate
Jan 29, 2010 11:34 AM UTC

Thanks!

Tthat works, except that browsers don't allow one tab to force focus onto another tab. This apparently is a deliberate design decision to mitigate the effects of malicious code. (The result is that the reference tab starts flashing but doesn't get focus.)

Thanks,

Peter

Translate