Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
65
rated 0 times [  66] [ 1]  / answers: 1 / hits: 31519  / 16 Years ago, wed, march 25, 2009, 12:00:00

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 Blur event nevers seem to fire if I click the parent window. Any suggestions/ideas on how achieve this?



update:



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


More From » jquery

 Answers
170

Total facepalm moment: In FireFox:




  • Tools

  • Options…

  • Content tab

  • Advanced button next to “Enable JavaScript”

  • check the box named Raise or Lower Windows



This is turned off by default and must be enabled. And also, i assumed that since it didnt work in Chrome, that Safari would be the same, but you know what they say about assuming (it works in Safari, but not Chrome).


[#99795] Thursday, March 19, 2009, 16 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
rossthomasn

Total Points: 122
Total Questions: 78
Total Answers: 105

Location: South Georgia
Member since Sun, Aug 8, 2021
3 Years ago
rossthomasn questions
Wed, Mar 16, 22, 00:00, 2 Years ago
Wed, May 5, 21, 00:00, 3 Years ago
Thu, Nov 26, 20, 00:00, 4 Years ago
Sun, May 31, 20, 00:00, 4 Years ago
;