By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,846 Members | 1,631 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,846 IT Pros & Developers. It's quick & easy.

Window focus() command won't work on America Online

P: n/a
Help!

Opening a new window using the window.open( ) command works great
for opening new windows and having them on top and having the focus.
The window.focus command brings any existing windows to the front
(top) in Netscape, IE and Opera. However, this command does nothing
when you access the web page through AOL, even though they say this is
IE. Once a window is behind (blurred), I have been unable to bring it
back to the front without 1. closing it, and 2. re-opening it, which
stinks.

Anybody ever solve this one?

Thanks,
Fred
Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
DU
Fred Snider wrote:
Help!

Opening a new window using the window.open( ) command works great
for opening new windows and having them on top and having the focus.
The window.focus command brings any existing windows to the front
(top) in Netscape, IE and Opera. However, this command does nothing
when you access the web page through AOL, even though they say this is
IE. Once a window is behind (blurred), I have been unable to bring it
back to the front without 1. closing it, and 2. re-opening it, which
stinks.

Anybody ever solve this one?

Thanks,
Fred

No url, no excerpt of relevant code: how do you expect readers of this
newsgroup to "solve this one"?

DU
--
Javascript and Browser bugs:
http://www10.brinkster.com/doctorunclear/
- Resources, help and tips for Netscape 7.x users and Composer
- Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x
http://www10.brinkster.com/doctorunc...e7Section.html

Jul 20 '05 #2

P: n/a
Fred Snider wrote:
Opening a new window using the window.open( ) command works great
for opening new windows and having them on top and having the focus.
The window.focus command brings any existing windows to the front
(top) in Netscape, IE and Opera. However, this command does nothing
when you access the web page through AOL, even though they say this is
IE. Once a window is behind (blurred), I have been unable to bring it
back to the front without 1. closing it, and 2. re-opening it, which
stinks.
That is not an AOL-IE issue, it depends on the UA how to handle
window.open(...), window.focus() and window.blur() since `window'
is a host object. There is no specification that imposes the new
window to be focused automagically or even focusable.
Anybody ever solve this one?


Try this:

// open new window
var foobar = window.open(...);

// check if we can focus it
if (foobar && window.focus && foobar.focus)
{
window.focus(); // focus the opener
if (window.blur) // check if we can blur
window.blur(); // blur the opener explicitely
foobar.focus(); // focus the popup
}

If the UA does not support Window.focus() there is no way other than
you have tried (and should avoid because it eats system resources).
PointedEars
Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.