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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Fred Snider

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

    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
  • DU

    #2
    Re: Window focus() command won't work on America Online

    Fred Snider wrote:
    [color=blue]
    > 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[/color]


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

    DU
    --
    Javascript and Browser bugs:

    - Resources, help and tips for Netscape 7.x users and Composer
    - Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x


    Comment

    • Thomas 'PointedEars' Lahn

      #3
      Re: Window focus() command won't work on America Online

      Fred Snider wrote:
      [color=blue]
      > 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.[/color]

      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.
      [color=blue]
      > Anybody ever solve this one?[/color]

      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

      Comment

      Working...