Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

<body onload="this.window.focus();" > Fails in FF 2

1,046 views
Skip to first unread message

Roger

unread,
Nov 17, 2006, 12:53:43 PM11/17/06
to
My use of <body onload="this.window.focus();" > is failing in Firefox 2.
I have web pages that open popup windows with images. If a user
clicks on a link that opens a new named window, then returns to the main
page, and then clicks on a link that opens the same named window with a
different url, the window updates itself but does not achieve focus.

As far as I know, the onload="this.window.focus() works on every browser
except FF 2.

I have the tabs option turned off.

Is this a FF 2 bug or is there a preferred way to accomplish the result?

Roger

David Pyles

unread,
Nov 17, 2006, 1:04:18 PM11/17/06
to
Try onLoad="self.focus() That works for me.
Dave Pyles

Roger

unread,
Nov 17, 2006, 2:15:30 PM11/17/06
to

I tried self.focus(); but had same result. It fails to put the window
in focus with Firefox 2 but works with Firefox 1.5.7, IE 6 and 7 and
Opera 9.

This web site shows the same problem:
http://www.webreference.com/javascript/960826/windows.html

Clicking the "Create Window" button opens a new window. After clicking
the original window to hide the new window, clicking the "Put Window In
Focus" button fails on Firefox 2.

Roger

Ralph Fox

unread,
Nov 17, 2006, 3:10:25 PM11/17/06
to


Clicking the "Put Window In Focus" button works for me in Firefox 2.


Check your Firefox 2 settings at

1. Go to Tools -> Options -> Content
2. Make sure "Enable JavaScript" is turned on.
3. Next to "Enable JavaScript", click the "Advanced" button.
4. Make sure that there is a check-mark in the box
[x] Raise or lower windows

If the setting "Raise or lower windows" is turned off, then
this disables the window.focus() method.


If that doesn't solve the problem, you may need to check whether
you have any "security policies" defined in Firefox 2 which may be
disabling window.focus() for all or some sites. See
http://www.mozilla.org/projects/security/components/ConfigPolicy.html
http://kb.mozillazine.org/Security_Policies


--
Cheers,
Ralph


moz man

unread,
Nov 18, 2006, 12:48:32 AM11/18/06
to
You have to target the opened window.

Roger

unread,
Nov 18, 2006, 11:08:41 AM11/18/06
to

Thank you - The "Raise or lower windows" option was unchecked. Checking
the box solved the problem.

Roger

0 new messages