We have to access the native event handlers/triggers directly, otherwise they won't execute in most modern browsers. Fixes #5124.

This commit is contained in:
John Resig 2009-12-09 13:53:07 -08:00
parent 5e2163085c
commit 86bbf9cf87

View file

@ -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;
}