I donβt know who this can help, but at least once I found myself with mixed code that looks like this:
... .trigger('myevent', $.Event('myevent', {data: 'foo',result: 'bar'}))'
i.e. both provide the event name as a parameter for .trigger and provide the user object ** user data ** to the event object.
The code must be either
... .trigger($.Event('myevent', {data: 'foo',result: 'bar'}))'
or
... .trigger('myevent', {data: 'foo',result: 'bar'})'
of course, they are not identical in where you get the data in the event handler, but at least they both work ...
source share