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

F

Fred Snider

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
 
D

DU

Fred said:
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/doctorunclear/Netscape7/Netscape7Section.html
 
T

Thomas 'PointedEars' Lahn

Fred said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top