I am trying to bring focus to window using jquery. The window is popup
initiated through a button click on the parent page. I have some ajax
calls going on in the child window, so data is being updated. My issue
is that if the user clicks on the parent window and hides the child
behind it, i would like to bring that child window back to the
forefront if there is a data update.

inside $(document).ready I wire up these events:

  $(window).blur(function(){
        WindowHasFocus =false;
}).focus(function(){
        WindowHasFocus =true;
});

Then, if data is updated, I call this function:

function FocusInput(){
     if(!WindowHasFocus){
          $(window).focus(); }
}

This works as expected in IE8, but in FireFox(and all other browsers)
the $(window).focus(); doesnt seem to do anything. Any suggestions/
ideas on how achieve this?

Reply via email to