[EMAIL PROTECTED] schrieb:
> Yeah, that makes sense, use browser detection to catch those few hard to
> detect bugs, but use object detection by default.
>
> Wouldn't it be a good idea to re-write the event functions something like
> this? (Just an example, not tested in jquery) :
>
>               fix: function(event) {
>                       // check IE, and get window event:
>                       if (!event) event = window.event;
>                       // fix target property:
>                       if (event.target) targ = event.target;
>                       else if (event.srcElement) targ = event.srcElement;
>                       if (targ.nodeType == 3) // defeat Safari bug
>                               targ = targ.parentNode;
>                       if(!targ)return false;
>                       event.cancelBubble = true;
>                       if (event.stopPropagation) event.stopPropagation();
>                       return event;
>               }
>
>       Instead of the current:
> [...]
>
> The code example might not be working in jQuery, it is just an example. It
> seems to me it should be possible to reduce the use of browser-detection to a
> bare minimum this way, which should make it much easier to maintain the code
> as new browsers come out, and existing ones change their capabilities.
>   
That is a good example where some browser-detection could be avoided. 
Could you please post that as a bug report, and add other examples if 
you spot any?

-- 
Jörn Zaefferer

http://bassistance.de


_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to