Skip to main content
GameDev.net gamedev.net
🔒 Locked

[web] Javascript focus() in Firefox 3.5

Started by BS-er Sep 15, 2009 at 3:42 PM 0 replies 1.9k views
Original Post
BS-er
BS-er
I have the following function in the web page:

function ShowHelp(tag)
{
   if (tag == "") { tag = "empty"; }
   helpWindow = window.open(tag + ".htm", "GameHelp", "location=1, status=1, scrollbars=1, width=600, height=200");
   helpWindow.moveTo(0,0);
   helpWindow.focus();
}


Prior to Firefox 3.5 on XP, this function did all that was expected, ending with the popup having focus even if the "GameHelp" popup window was already opened. After upgrading to Firefox 3.5, the popup window "GameHelp" gains focus when it is first created, but will not gain focus if this function is called while the "GameHelp" window already exists. It does move to 0,0 and goes to the new URL, suggesting that this function is indeed being called. The prior behavior before 3.5 is what I require. If the popup already exists, set it to a possibly new URL and give it focus. However it no longer gains focus with Firefox 3.5. Is there something I can do differently that will give an existing "GameHelp" popup window focus? IE 8 seems to work "properly" in this regard.
konForce
konForce
Check your JS settings. FF by default disables the ability to "Raise or lower windows."

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.