What is triggering window.onBlur ???
Posted on 2007-07-24
I have a very elaborate web application that is built on ChatZilla. I am tapping into the window.onFocus and window.onBlur hooks to accomplish something. It all works well, except for this strange problem:
In IE 6 only, window.onBlur is not triggered when the window loses focus. Rather, once the window regains focus, window.onFocus is called immediately followed by window.onBlur (usually the same millisecond, but up to ~20 ms later).
My question is: any general ideas on tracing back to what is causing this onFocus/onBlur activity? It has something to do with the application and not the environment, because this does not occur under the same circumstances with a test app, like this:
var i = 0;
function prependText(id, text)
var el = document.getElementById(id);
el.innerHTML = "<p>" + ++i + ". " + text + "</p>" + el.innerHTML;
function window_onblur ()
function window_onfocus ()
Unfortunately the app consists of many files and it's a company proprietary thing, so I can't post much code. I'm just looking for general suggestions. It may be helpful to know that there is a small Java applet embedded in the page (can these applets partake in focus? are they considered a part of the DOM?). Is it possible that some element in the document is stealing the focus away from the window (it would seem, in this case, that the window would still have focus).
Thanks for the help!