Ref cc324abf: use acceptData to determine when it is safe to add event handlers

This commit is contained in:
Richard Gibson 2013-01-16 14:36:24 -05:00
parent cc324abf73
commit 50290b8ffb

View File

@ -24,9 +24,9 @@ jQuery.event = {
var handleObjIn, eventHandle, tmp,
events, t, handleObj,
special, handlers, type, namespaces, origType,
// Don't attach events to noData or text/comment nodes (but allow plain objects)
elemData = elem.nodeType !== 3 && elem.nodeType !== 8 && jQuery._data( elem );
elemData = jQuery._data( elem );
// Don't attach events to noData or text/comment nodes (but allow plain objects)
if ( !elemData ) {
return;
}