I need advice from experts ! What is the best way to convert the
output of DOM.formContents() ( an array like : [ ['name1', 'name2',
'nameN'], ['value1', 'value2', 'valueN'] ] ) into an object like :
{ 'name1': 'value1', 'name2': 'value2', 'name3': 'value3'} ?
The problem is easy to solve, but I am just wondering if MochiKit
offers a quick and elegant answer to that (for instance, a kind of
opposite to Base.items() ).
Thanks,
paf
will give you what you want.
- Aaron
Which doesn't really get you anywhere, so I'm thinking you'd just do
it inline.
Sorry about that.
- Aaron
var data = formContents(foo);
var names = data[0];
var values = data[1];
var nbFields = names.length;
for(var i = 0; i < nbFields; i++) {
params[names[i]] = values[i];
}
Wow, difficult ! =)
paf