How to bring focus to a window in jquery?
<p>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.</p>

<p>inside $(document).ready I wire up these events:</p>

<pre><code>  $(window).blur(function(){
    WindowHasFocus =false;
}).focus(function(){
    WindowHasFocus =true;
});
</code></pre>

<p>Then, if data is updated, I call this function:</p>

<pre><code>function FocusInput(){

 if(!WindowHasFocus){
    $(window).focus();
 }
}
</code></pre>

<p>This works as expected in IE8, but in FireFox(and all other browsers) the Blur event nevers seem to fire if I click the parent window.  Any suggestions/ideas on how achieve this?</p>

<p>update:</p>

<p>Total facepalm moment:
In FireFox:
* Tools
* Options…
* Content tab
* Advanced button next to “Enable JavaScript”
* check the box named "Raise or Lower Windows"</p>
