By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,252 Members | 1,684 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,252 IT Pros & Developers. It's quick & easy.

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

P: 51
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
Share this Question
Share on Google+
5 Replies


acoder
Expert Mod 15k+
P: 16,027
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

P: 51
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
Expert Mod 15k+
P: 16,027
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

P: 51
Thank you, acoder. I'm going to study that and have a try test.
Jan 27 '09 #5

P: 1
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.