Modify ↓
Ticket #9146 (closed bug: duplicate)
jQuery( jsObject ).trigger() executes object methods
| Reported by: | Akania | Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | 1.next |
| Component: | event | Version: | 1.5.1 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
Egz:
var myobject = {
someStuff : function(){ console.log('method someStuff'); }
}; jQuery(myobject).trigger('someStuff')
trigger('someStuff') causes execution of myobject 'someStuff' method. I don't know what to think about it - for me it is a bug. I tried to implement non-DOM custom events using bind & trigger. after giving one of events and one of object methods same name i've noticed this strange behaviour.
Does jQuery doesn't provide mechanism for creating custom non-DOM events?
Change History
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

http://jsfiddle.net/akania/DyEze/
Using triggerHandler() fix this behaviour.