🌐 AI搜索 & 代理 主页
Skip to content

Commit 3ec2f1a

Browse files
committed
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.
1 parent 1052792 commit 3ec2f1a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/event.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,10 @@ jQuery.event = {
253253

254254
var nativeFn, nativeHandler;
255255
try {
256-
nativeFn = elem[ type ];
257-
nativeHandler = elem[ "on" + type ];
256+
if ( !(elem && elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()]) ) {
257+
nativeFn = elem[ type ];
258+
nativeHandler = elem[ "on" + type ];
259+
}
258260
// prevent IE from throwing an error for some elements with some event types, see #3533
259261
} catch (e) {}
260262

0 commit comments

Comments
 (0)