Forums > Javascript

How to pass a list as parameter to js

December 16, 2012 | 8:20 pm

I’m trying to get a list into a javascript function, but i have no idea what to do. If i do…

function test(value)
{
    post(value)
}

… i only see the first item in the list.

It could be that i’m not preparing my message correctly. I used the prepend object to prepend the list with the js-functionname i want to call.


December 16, 2012 | 9:29 pm

Use the arrayfromargs() method:

function test()
{
    var args = arrayfromargs(arguments);
    post('args:', args, 'n');
}

December 16, 2012 | 10:32 pm

wow, thanks *a lot*!


Viewing 3 posts - 1 through 3 (of 3 total)