Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Firefox window.focus not working

Status
Not open for further replies.

carrerga

Programmer
Aug 14, 2007
2
US
I'm having the problem discussed in thread216-1165047.

What I would expect is for the firefox window to come to focus when window.focus() is called. IE window does focus when I execute the same command.

If the window does not come to focus, then what is the purpose of firefox's window's focus method?

Note: I have no frames and the page is based on ajax so my javascript is enabled.
 
Interestingly window.blur() works fine in the scenario you are in... but always window.focus() appears to do nothing in Firefox. I was testing using the code you last posted in the other thread, on MacOSX Firefox 2 (in both windows and tabs).

Cheers,
Jeff

[tt]Jeff's Blog [!]@[/!] CodeRambler
[/tt]

Make sure your web page and css validates properly against the doctype you have chosen - before you attempt to debug a problem!

FAQ216-6094
 
BillyRayPreachersSon,

I have gone through the code line by line with a debugger and the last function I call is the function that sets the window focus. I'm afraid that directing you to the thousands of lines of code on the page won't do any good. I'm certain that the code is bug free, I was wondering if there was an issue with firefox that addressed this problem because so far I haven't stumbled upon it, and I've looked at the documentation of firefox's bugs.

The following is the code that I'm executing:

wFoc(window);
function wFoc(w)
{
if(w.focus)//if browser supports the focus method
w.focus();
}

By the way, I've had this problem for months and through several firefox upgrades, I'm now using version 2.0.0.6.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top