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

(cherry picked from commit 50290b8ffb)
This commit is contained in:
Richard Gibson
2013-01-16 14:36:24 -05:00
parent 8f72967ee2
commit 64bb0c4135

View File

@@ -25,9 +25,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;
}