Bug Tracker

Opened 16 years ago

Closed 16 years ago

Last modified 11 years ago

#1053 closed bug (fixed)

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 (last modified by john)

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 16 years ago.

Download all attachments as: .zip

Change History (4)

Changed 16 years ago by jablan

Attachment: events.patch added

comment:1 Changed 16 years ago by jablan

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

comment:2 Changed 16 years ago by brandon

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.

comment:3 Changed 16 years ago by john

Description: modified (diff)
Resolution: fixed
Status: newclosed

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

Note: See TracTickets for help on using tickets.