Out of curiosity -- what is the purpose of / use cases for jQuery\'s triggerHandler? As far as I can tell, the only \"real\" differences between trigger>
For me the main difference is that 'triggerHandler' returns whatever was returned by the last handler, whereas 'trigger' returns the jQuery object.
So, for a handler such as:
$( document ).on( 'testevent', function ()
{
return false;
});
Using 'triggerHandler' you can do the following:
if( $( document ).triggerHandler( 'testevent' ) === false )
{
return;
}
So you would use 'triggerHandler' if you wanted to respond to the result returned from the handler.