]> source.dussan.org Git - jquery.git/commitdiff
Ref 8f72967e: use acceptData to determine when it is safe to add event handlers
authorRichard Gibson <richard.gibson@gmail.com>
Wed, 16 Jan 2013 19:36:24 +0000 (14:36 -0500)
committerRichard Gibson <richard.gibson@gmail.com>
Wed, 16 Jan 2013 19:41:18 +0000 (14:41 -0500)
(cherry picked from commit 50290b8ffb05c504d3866a619f282bf795bc01f6)

src/event.js

index 6554769ba09fb389fc12833fe8dca2691ac597ee..5841aff7ca64baf028c16ade040689f0e6c4aa54 100644 (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;
                }