Skip to content

Commit

Permalink
We have to access the native event handlers/triggers directly, otherw…
Browse files Browse the repository at this point in the history
…ise they won't execute in most modern browsers. Fixes #5124.
  • Loading branch information
jeresig committed Dec 9, 2009
1 parent 5e21630 commit 86bbf9c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/event.js
Expand Up @@ -264,12 +264,12 @@ jQuery.event = {
if ( !bubbling && nativeFn && !event.isDefaultPrevented() && !isClick ) {
this.triggered = true;
try {
nativeFn();
elem[ type ]();
// prevent IE from throwing an error for some hidden elements
} catch (e) {}

// Handle triggering native .onfoo handlers
} else if ( nativeHandler && nativeHandler.apply( elem, data ) === false ) {
} else if ( nativeHandler && elem[ "on" + type ].apply( elem, data ) === false ) {
event.result = false;
}

Expand Down

0 comments on commit 86bbf9c

Please sign in to comment.