Guys:
I want to implement a modal pop up window in my application, that means focus should be always in pop up window unless user fill the information and click close.
I want to develope a cross-browser javascript library (I do not want to use the window.openModalDialog, it is IE only).
Here is the code I put in pop up window.
[CODE]var child_window_force_selector = {
init : function() {
var opener = window.opener;
var child_window = self;
if (opener.addEventListener) {
opener.addEventListener(“focus”, function() {
opener.blur();
child_window.focus();
}, false)
} else if (opener.attachEvent) {
opener.attachEvent(“onfocus”, function() {
opener.blur();
child_window.focus();
})
}
}
}
child_window_force_selector.init();
It works fine in IE but does not work in firefox. I registered some onfocus hanlder on the child window for debug purpose, it seems even child_window.focus() got invoked, but event handler is not triggered at all, I searched it seems not a known issue for firefox….
can anyone give me a hint on this.