什么是 jQuery 之类的和/或在 jQuery(或一般的浏览器 javascript 中)获取事件的原始目标的最佳实践方式。
我一直在使用这样的东西
$('body').bind('click', function(e){
//depending on the browser, either srcElement or
//originalTarget will be populated with the first
//element that intercepted the click before it bubbled up
var originalElement = e.srcElement;
if(!originalElement){originalElement=e.originalTarget;}
});
这有效,但我对两行特征嗅探不满意。有没有更好的办法?