[RESOLVED]How to pass an array as parameter to custom event?

        $(function () {
            $('div').bind('test', function (event, data) {
            $('div').trigger('test', [1, 2, 3]);

the result is a single int 1,

however, I want the result is entire array [1, 2, 3]

One workaround is set array to a property of an object. Is there a better way?

ok, find solution myself


$('div').trigger('test', new Array( [1, 2, 3]));

Leave a Reply