louis w wrote:
> This is what I ended up doing:
>                               if (_is_ie) {
>                                       // IE Only focus/blur event listeners
>                                       f.observe('focusin', 
> this.onFocus.bind(this));
>                                       f.observe('focusout', 
> this.onBlur.bind(this));
>                               } else {
>                                       // Firefox & Safari focus/blur event 
> listeners
>                                       f.addEventListener('focus', 
> this.onFocus.bind(this), true);
>                                       f.addEventListener('blur', 
> this.onBlur.bind(this), true);
>                               }
> then inside the onFocus and onBlur I get the element (Event.element)
> and check it's nodeName to see if I should do anything.

I think that you should check for existence of addEventListener 
method, and use it at first, and if it does not exist, then fall back 
to observing microsoft proprietary events.
You can't be sure if some browser isn't lying about being IE, or if 
your test havent' generated false posivie.

So, try this:

if (typeof f.addEventListener == 'function') {
        f.addEventListener (.....)
} else if (_is_ie ) {
} else {
     // unlikely, but who knows...


You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to