0

Possible Duplicate:
why window.focus() not working in Mozilla firefox?

I am implementing multitab feature for my application and I am finding difficulties to implement those when it comes to set the focus for the opened window. Firefox sets the focus for the first time when the window is opened but next time it doesnt.

For example -

My application always opens in window with name 'baseWindow'. A page has following link -

Link1 - Opens a new window with name 'window2'

onclick for above link has following function

    function linkOnClick(){
          var wind1=window.open('window2Page.html','window2');
          wind1.focus();
}

When the link is clicked for the first time i.e. window2 doesnt exists, at that time the focus is automatically given to window2. But if i come on first window and click on the link again then the focus is not given on the window2 it stays on the same window.

Community
  • 1
  • 1
azhar_salati
  • 1,554
  • 5
  • 28
  • 54

2 Answers2

1

Whether focus() is allowed to raise existing windows is a user preference in Firefox, defaulting to "no" to deal with all the obnoxious popups/popunders people were creating for a while there....

Boris Zbarsky
  • 34,758
  • 5
  • 52
  • 55
0

try this way

 function linkOnClick(){
    return function(){
     var wind1=window.open('window2Page.html','window2');
     wind1.focus(); 
    }
 }
Roman
  • 504
  • 4
  • 10