Problem passing array to triggerHandler
Hi
When I pass an array as the second parameter to the triggerHandler method, which takes (event, data), I find that only the first element of the array arrives in the handler function. Ie, if I execute the following call:
var event = jQuery.Event('loop_submitted');
jQuery('#pubsub_node').triggerHandler(event,myArray);
this handler:
jQuery('#pubsub_node').bind('loop_submitted', function(event,myArray){
only gets the first element of myArray.
However, I have seen in a jQuery example where the array is passed with [] round it like this:
jQuery('#pubsub_node').triggerHandler(event,[myArray]);
and when I do this, the whole array arrives in the called handler fine.
I've never seen this [] syntax before, and I can't find it in the documentation. It clearly works, but I don't understand why. Should arrays always be passed with this syntax? Can anyone help me out?
Thanks!