Odd Netscape: Sound steals focus.

Discussion in 'Javascript' started by Robert Dickow, Nov 25, 2003.

  1. Here's an interesting problem:

    When Netscape Nav plays an embedded sound, the current window will
    lose focus. Specifically, a user may be typing into a text
    input field, but an embedded sound in another frame (refreshed) will
    cause the window to lose focus. The user can not even regain focus
    by clicking in the text field; one must click first in the window,
    then click in the text input field in order to continue typing.

    (Internet Explorer has no such problem, BTW.)

    Anyway, I am trying to kludge a workaround by having some javascript
    attempt to reset the focus to the input field after the embedded
    sound is played. Not luck yet making this work, I'm afraid:

    var oldVal = window.parent.frames['input'].window.document.forms
    ['MsgForm'].elements['M'].value; // for debugging, get what may be in
    there.
    window.parent.frames['input'].window.document.forms
    ['MsgForm'].elements['M'].value = oldVal + " testing"; // type it out.
    top.window.frames['input'].window.document.forms
    ['MsgForm'].window.focus(); // try to regain focus.
    // window.top.window.frames['input'].window.document.forms
    ['MsgForm'].elements['M'].window.focus(); // no luck either.

    Any thoughts?
    --
    ***********************************
    * Bob Dickow () *
    * Hampton School of Music *
    ***********************************
    Robert Dickow, Nov 25, 2003
    #1
    1. Advertising

  2. Adding to my own post... It seems that the problem
    is really one in NetScape in the QuickTime pluggin
    that plays .wav files. It must be essentially
    opening a window (even if the embed specifies
    no dimensions and/or the hidden attribute.). So,
    I found out that in fact my code below does 'work'
    more or less on its own, but 'fails' because the
    pluggin seems to disorient things a bit. Now, if
    I can figure out how to get the code recover
    from the pluggin....

    Robert Dickow <> wrote in
    news:Xns943E45D6ED83dickowuidahoedu@216.168.3.44:

    > Here's an interesting problem:
    >
    > When Netscape Nav plays an embedded sound, the current window will
    > lose focus. Specifically, a user may be typing into a text
    > input field, but an embedded sound in another frame (refreshed) will
    > cause the window to lose focus. The user can not even regain focus
    > by clicking in the text field; one must click first in the window,
    > then click in the text input field in order to continue typing.
    >
    > (Internet Explorer has no such problem, BTW.)
    >
    > Anyway, I am trying to kludge a workaround by having some javascript
    > attempt to reset the focus to the input field after the embedded
    > sound is played. Not luck yet making this work, I'm afraid:
    >
    > var oldVal =
    > window.parent.frames['input'].window.document.forms
    > ['MsgForm'].elements['M'].value; // for debugging, get what may be in
    > there.
    > window.parent.frames['input'].window.document.forms
    > ['MsgForm'].elements['M'].value = oldVal + " testing"; // type it out.
    > top.window.frames['input'].window.document.forms
    > ['MsgForm'].window.focus(); // try to regain focus.
    > // window.top.window.frames['input'].window.document.forms
    > ['MsgForm'].elements['M'].window.focus(); // no luck either.
    >
    > Any thoughts?




    --
    ***********************************
    * Bob Dickow () *
    * Hampton School of Music *
    ***********************************
    Robert Dickow, Nov 29, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andrew Thompson

    Re: Applet steals focus...

    Andrew Thompson, Jan 9, 2004, in forum: Java
    Replies:
    12
    Views:
    2,928
    Andrew Thompson
    Jan 26, 2004
  2. Andrew Thompson

    Re: Applet steals focus...

    Andrew Thompson, Sep 2, 2004, in forum: Java
    Replies:
    0
    Views:
    542
    Andrew Thompson
    Sep 2, 2004
  3. Replies:
    14
    Views:
    529
    Lee Waun
    Jan 5, 2005
  4. Andreas Leitgeb
    Replies:
    1
    Views:
    612
    Andreas Leitgeb
    Aug 5, 2010
  5. Roger
    Replies:
    3
    Views:
    305
Loading...

Share This Page