#12073 closed bug (duplicate)
Triggering an event calls the method with the same name as the event type
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.7.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Example:
var obj = {}; obj.cancel = function() { $(obj).trigger('cancel'); }; obj.cancel();
This results in an infinite loop because triggering 'cancel' calls 'cancel' on itself (which re-triggers 'cancel'...).
Tested against 1.7.1 and 1.7.2
Note: See
TracTickets for help on using
tickets.
Yep, as documented. And if you don't want it to do that? Read the documentation for the answer. http://api.jquery.com/trigger/