9
   $('<span>test</span>')
    .change(function(e){console.log(e.data);})
    .triggerHandler('change',{foobar:1});

I'm doing it wrong or it's bugged?

Thanks ;)

Misha Moroshko
  • 157,453
  • 220
  • 487
  • 722
Somebody
  • 8,906
  • 25
  • 92
  • 141

1 Answers1

14

The extra data is passed as argument to the handler:

$('<span>test</span>')
.change(function(e, data){console.log(data);})
.triggerHandler('change',{foobar:1});

The documentation also says that it has to be an array, though it works with one object too.

Felix Kling
  • 756,363
  • 169
  • 1,062
  • 1,111