Side navigation
#9146 closed bug (duplicate)
Opened May 06, 2011 01:21PM UTC
Closed May 07, 2011 04:22AM UTC
Last modified May 07, 2011 04:22AM UTC
jQuery( jsObject ).trigger() executes object methods
Reported by: | Akania | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | 1.next |
Component: | event | Version: | 1.5.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
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?
http://jsfiddle.net/akania/DyEze/
Using triggerHandler() fix this behaviour.