469,276 Members | 2,057 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,276 developers. It's quick & easy.

How to set focus on a window in multi-tab windows

On firefox multi-tab, I open a window with ref=window.open(). It works. A new window is opened in a new tab. On parent window, there is button doing ref.focus(). But it won't put focus on that new window. So how do I set focus on a window in a multi-tab hosting?

Jack
Jan 22 '09 #1
5 17602
acoder
16,027 Expert Mod 8TB
The simple answer is you can't, but you can in browser-specific code, e.g. XUL, extensions, etc. - see https://developer.mozilla.org/en/Cod...Tabbed_browser
Jan 22 '09 #2
Thank you, acoder. After study the page mentioned, still have no idea about how to activate a specific tab on firefox. Do you have sample code about it? thank you very much!
Jan 23 '09 #3
acoder
16,027 Expert Mod 8TB
The sample code is there. It's a case of using it in the correct context.

Note that using this code would be Mozilla-specific making use of XUL. To get started, see https://developer.mozilla.org/en/XUL_Tutorial.
Jan 23 '09 #4
Thank you, acoder. I'm going to study that and have a try test.
Jan 27 '09 #5
I actually had this same question - here's a solution I found (I know this thread is old, but I know it can be useful to others)

I used:
Expand|Select|Wrap|Line Numbers
  1. ref=window.open().focus();
This will not work with all browsers, at least not yet, but it certainly will work with some, and it's worth a try!
Feb 20 '12 #6

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by titouille | last post: by
1 post views Thread by Robert Dickow | last post: by
31 posts views Thread by Benno Bös | last post: by
1 post views Thread by WH | last post: by
2 posts views Thread by Elsa Luiz | last post: by
5 posts views Thread by Wei | last post: by
2 posts views Thread by Charles | last post: by
7 posts views Thread by marty.overdear | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.