Ticket #8876 (closed feature: wontfix)
jQuery.ajax, jQuery.param and form input serialization
|Reported by:||christian@…||Owned by:||christian@…|
It seems that it's a mistake to rely on the default data serialization (jQuery.param) used by jQuery.ajax. Specifically when data is an array of form elements.
While the API docs point out that jQuery.param should only be used for objects, the comments in code indicate otherwise https://github.com/jquery/jquery/blob/1.5.2/src/ajax.js#L740: " Serialize an array of form elements..."
For starters I'd advocate to removing the comment from the code. I also think it would be nice to perform some detection on data such that jQuery.serializeArray gets called if necessary.
While it can be said rtfm, "don't pass form inputs to jQuery.ajax (and by extension jQuery.param)",because jQuery.param does successfully serialize *some* form elements it's not immediately clear that this a bad idea.
- Owner set to christian@…
- Status changed from new to pending
- Component changed from unfiled to ajax