Skip to main content

Bug Tracker

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?

Attachments (0)
Change History (3)

Changed May 06, 2011 01:24PM UTC by Akania comment:1

http://jsfiddle.net/akania/DyEze/

Using triggerHandler() fix this behaviour.

Changed May 07, 2011 04:22AM UTC by rwaldron comment:2

component: unfiledevent
priority: undecidedlow
resolution: → duplicate
status: newclosed

Changed May 07, 2011 04:22AM UTC by rwaldron comment:3

Duplicate of #7930.