With jQuery .on() you can pass an optional parameter to set the event data. Can you do this with trigger as well?
Yes. The documentation says:
.trigger( eventType [, extraParameters] )
Note the difference between the extra parameters we're passing here and the
eventDataparameter to the.bind()method. Both are mechanisms for passing information to an event handler, but theextraParametersargument to.trigger()allows information to be determined at the time the event is triggered, while theeventDataargument to.bind()requires the information to be already computed at the time the handler is bound.