How to pass a list as parameter to js

Dec 16, 2012 at 8:20pm

How to pass a list as parameter to js

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.

#65705
Dec 16, 2012 at 9:29pm

Use the arrayfromargs() method:

function test()
{
    var args = arrayfromargs(arguments);
    post('args:', args, 'n');
}
#236720
Dec 16, 2012 at 10:32pm

wow, thanks *a lot*!

#236721

You must be logged in to reply to this topic.