Thanks for the anwers. I have finally opted for :
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
On 20 fév, 20:39, "Aaron Faanes" <[EMAIL PROTECTED]> wrote:
> Er, I'm sorry, it will almost give you what you want. It wont wrap it
> up in an object, though. It'll just be [ [array[0][0], array[1][0]],
> [array[0][1], array[1][1] ] ... ]
>
> Which doesn't really get you anywhere, so I'm thinking you'd just do
> it inline.
>
> Sorry about that.
>
> - Aaron
>
> On Feb 20, 1:35 pm, "Aaron Faanes" <[EMAIL PROTECTED]> wrote:
>
> > MochiKit.Iter.izip(array[0], array[1])
>
> > will give you what you want.
>
> > - Aaron
>
> > On Feb 20, 10:42 am, "paftek" <[EMAIL PROTECTED]> wrote:
>
> > > Hello there,
>
> > > 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
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"MochiKit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---