faqts : Computers : Programming : Languages : JavaScript : Windows

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

92 of 112 people (82%) answered Yes
Recently 7 of 10 people (70%) answered Yes

Entry

How do I bring a window to the front?
How do I focus a window?

Nov 23rd, 2005 23:24
Vivek Lakhanpal, John Marc, jsWalter, Martin Honnen,


window objects have a 
  focus
method for that so
  window.focus()
brings the current window to the front,
  var win = open ('whatever.html', 'windowName');
  ...
  win.focus();
brings the window with reference win to the front.
=============
w torres 3-27-02
When I tried this code, all it did was make the button in the START bar 
flash.
The window did not go front.
Any ideas.
Walter
-----------------
Works fine here.  Try naming the window reference something else (win)
------------------------------
Hi,
Everything works fine here as you have mentioned above. It works
prefectly fine in IE but in Mozilla browser it doesn't behave as
intended i.e. it brings window to focus only if i have set window down
by click minimize button of browser. If i keep window maximize and click
other window or browser it doesn't bring the window in front/focus. I am
using parent window not opener window. Moreover in case of multiple
tabing browsers is there any way we can bring intented tab in focus? 
Thanks,
Vivek