Skip to main content

Bug Tracker

Side navigation

#1053 closed bug (fixed)

Opened March 16, 2007 12:30PM UTC

Closed July 15, 2007 03:08PM UTC

Last modified March 15, 2012 05:45PM UTC

Manual (JS, not using jQuery) invoking of event handlers doesn't fire events attached using jQuery

Reported by: jablan Owned by:
Priority: minor Milestone: 1.1.4
Component: core Version: 1.1.3
Keywords: Cc:
Blocked by: Blocking:
Description

Event handlers attached by jQuery don't get triggered when calling onclick (onsubmit, onAnything) event handler manually from JavaScript. jQuery got these default handlers mapped to jQuery.event.handle function, but this function can not recognize the type of event when invoked manually (event parameter is null in that case). Illustration and more information could be found here: http://jquery.com/pipermail/discuss_jquery.com/2007-March/028421.html

This error gets particularily exposed when combining jQuery with ASP.NET, because ASP.NET is often submitting a form using JavaScript and calling onsubmit event handler beforehand. So in that case, none of the submit handlers assigned using jQuery will not be fired. Illustration and more information about this case can be found at http://jquery.com/pipermail/dev_jquery.com/2007-March/000760.html

Attachments (1)
  • events.patch (1.3 KB) - added by jablan March 16, 2007 12:44PM UTC.
Change History (3)

Changed March 16, 2007 12:45PM UTC by jablan comment:1

I have attached my patch, it solves the problem but I would like someone to review it. Thanks.

Changed April 26, 2007 06:44PM UTC by brandon comment:2

need: → Review

The event module in the latest SVN is now using DOM Level 2 event handlers (addEventListener/attachEvent) and this patch no longer applies.

Changed July 15, 2007 03:08PM UTC by john comment:3

description: Event handlers attached by jQuery don't get triggered when calling onclick (onsubmit, onAnything) event handler manually from JavaScript. jQuery got these default handlers mapped to jQuery.event.handle function, but this function can not recognize the type of event when invoked manually (event parameter is null in that case). Illustration and more information could be found here: http://jquery.com/pipermail/discuss_jquery.com/2007-March/028421.html\ \ This error gets particularily exposed when combining jQuery with ASP.NET, because ASP.NET is often submitting a form using JavaScript and calling onsubmit event handler beforehand. So in that case, none of the submit handlers assigned using jQuery will not be fired. Illustration and more information about this case can be found at http://jquery.com/pipermail/dev_jquery.com/2007-March/000760.htmlEvent handlers attached by jQuery don't get triggered when calling onclick (onsubmit, onAnything) event handler manually from JavaScript. jQuery got these default handlers mapped to jQuery.event.handle function, but this function can not recognize the type of event when invoked manually (event parameter is null in that case). Illustration and more information could be found here: http://jquery.com/pipermail/discuss_jquery.com/2007-March/028421.html \ \ This error gets particularily exposed when combining jQuery with ASP.NET, because ASP.NET is often submitting a form using JavaScript and calling onsubmit event handler beforehand. So in that case, none of the submit handlers assigned using jQuery will not be fired. Illustration and more information about this case can be found at http://jquery.com/pipermail/dev_jquery.com/2007-March/000760.html
milestone: 1.1.31.1.4
resolution: → fixed
status: newclosed
version: 1.1.21.1.3

This should be resolved now, since jQuery doesn't use the .onFOO handlers anymore.