I am using jQuery function .trigger( event [, extraParameters ] ) to trigger a function in a global object variable. The function runs, but with no extra parametrs, that are passed to the trigger function in an array, as the documentation says. What is wrong here?
The code: (jsfiddle)
var loc={
connect: function(e, p1, p2) {
console.log(p1); //this returns undefined
console.log(p2); //this returns undefined
}
}
$(document).ready(function(){
$(loc).trigger("connect",["a","b"]);
});