It's simply a way to create some kind of empty container to store event handlers.
Some jQuery methods can also be used on objects other than DOM elements, as mentioned in the jQuery documentation [docs]:
Working With Plain Objects
At present, the only operations supported on plain JavaScript objects wrapped in jQuery are: .data(),.prop(),.bind(), .unbind(), .trigger() and .triggerHandler(). The use of .data() (or any method requiring .data()) on a plain object will result in a new property on the object called jQuery{randomNumber} (eg. jQuery123456789).
// define a plain object
var foo = {foo:'bar', hello:'world'};
// wrap this with jQuery
var $foo = $(foo);
// test accessing property values
var test1 = $foo.prop('foo'); // bar
// test setting property values
$foo.prop('foo', 'foobar');
var test2 = $foo.prop('foo'); // foobar
// test using .data() as summarized above
$foo.data('keyName', 'someValue');
console.log($foo); // will now contain a jQuery{randomNumber} property
// test binding an event name and triggering
$foo.bind('eventName', function (){
console.log('eventName was called');
});
$foo.trigger('eventName'); // logs 'eventName was called'
[...]
and the .trigger documentation [docs]:
The .trigger() method can be used on jQuery collections that wrap plain JavaScript objects similar to a pub/sub mechanism; any event handlers bound to the object will be called when the event is triggered.
That's exactly what is happening in the code:
var o = $({}); creates a jQuery object from an empty, plain object.
o.bind.apply( o, arguments ); binds an event handler to that object.
o.trigger.apply( o, arguments ); triggers the event handlers bound to that object.