From: Richard Gibson Date: Wed, 16 Jan 2013 19:36:24 +0000 (-0500) Subject: Ref 8f72967e: use acceptData to determine when it is safe to add event handlers X-Git-Tag: 1.9.1~34 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=64bb0c4135aab74fd5958175deec89b18bb2256a;p=jquery.git Ref 8f72967e: use acceptData to determine when it is safe to add event handlers (cherry picked from commit 50290b8ffb05c504d3866a619f282bf795bc01f6) --- diff --git a/src/event.js b/src/event.js index 6554769ba..5841aff7c 100644 --- a/src/event.js +++ b/src/event.js @@ -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; }