diff options
author | John Resig <jeresig@gmail.com> | 2009-12-09 14:49:31 -0800 |
---|---|---|
committer | John Resig <jeresig@gmail.com> | 2009-12-09 14:49:31 -0800 |
commit | 3ec2f1aef6b137d0f639e2fc53f95352d24b9d90 (patch) | |
tree | 5c0cc8f2723f46488669a7b7d6daae5747210585 | |
parent | 1052792bb23b56d25dcbacd3816c8b5a08bc9b72 (diff) | |
download | jquery-3ec2f1aef6b137d0f639e2fc53f95352d24b9d90.tar.gz jquery-3ec2f1aef6b137d0f639e2fc53f95352d24b9d90.zip |
Make sure that we don't try to trigger non-existant native events on applets, embed, objects, etc. as it'll cause an exception with Java applets. Fixes #2414.
-rw-r--r-- | src/event.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/event.js b/src/event.js index e070cb261..afe92af59 100644 --- a/src/event.js +++ b/src/event.js @@ -253,8 +253,10 @@ jQuery.event = { var nativeFn, nativeHandler; try { - nativeFn = elem[ type ]; - nativeHandler = elem[ "on" + type ]; + if ( !(elem && elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()]) ) { + nativeFn = elem[ type ]; + nativeHandler = elem[ "on" + type ]; + } // prevent IE from throwing an error for some elements with some event types, see #3533 } catch (e) {} |