Nested param serialization
Hi Folks,
I'm experienceing some problems with jQuery 1.4(.1) with the "new" ajax param serialization.
My code does basically this:
- var ajaxparams = {
id: sid,
rm: rm || 'show_table',
somenode: "some data"
};
- var filter_obj = {enable_col_filter: []};
$('tr.listitems input:checkbox:checked').each(function(){
filter_obj.enable_col_filter.push($(this).val());
});
- $.extend(ajaxparams, filter_obj);
- $.post("some url", ajaxparams, function(data, textStatus){}
so I'm creating an array within the "ajaxparams" object, which I fill with some data. So far so good.
Problem here is, the $.post request creates a string like this:
&id=241&rm=show_table&enable_col_filter%5B%5D=title&....
Release Notes Snippet:
jQuery 1.4 adds support for nested param serialization in jQuery.param, using the approach popularized by PHP, and supported by Ruby on Rails. For instance,
{foo: ["bar", "baz"]}
will be serialized as “foo[]=bar&foo[]=baz”.
since I'm working with perl and not php, this issue is getting a little bit annoying.
Is my only way out
"jQuery.
ajaxSettings.
traditional = true;" here?