Brian ha scritto:
> Perhaps there should be a "FastSerialize" method, that doesn't guarantee
> semantic order, and uses every shortcut to cut down on dom-walking time? 
> This way, the developer can choose whether to use the faster method, or
> the slower-but-correctly-ordered method.
> 
> - Brian
> 
> 
>>> Can you explain why processing elements in semantic order is important?
>> Two reasons:
>>
>> $("input | select").eq(0)
>>
>> This should access the first matched element of input or select - when
>> the order isn't important, you'll never know which element will
>> actually be first. It's important that the element is actually the
>> first element in the document.
>>
>> Secondly, when serializing forms, the order of the elements that comes
>> back is frequently important - having a different order can cause
>> problems for certain applications.
>>

Thanks for your answers.

I agree with Brian about the need of a FastSerialize method.

I don't know how many applications can get in troubles receiving forms 
data in a not semantic order. Maybe it is worth considering to introduce 
an "OrderedSerialize" method, using the current ordered but slow 
implementation, and use a fast but unordered implementation as the 
default one. Ah, yes, this is an incompatible change for those 
applications :)

For my needs I preferred to use the fast way.
Here is the code of the modified serialize I use:
http://zone.spip.org/trac/spip-zone/browser/_plugins_/_dev_/-jQuery/form.js

Renato

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to