Commit 317ea5ca authored by Stefan Petre's avatar Stefan Petre

if one value of key/value pairs is array then treat each array value in part

parent 32816eff
...@@ -892,9 +892,16 @@ jQuery.extend({ ...@@ -892,9 +892,16 @@ jQuery.extend({
// Otherwise, assume that it's an object of key/value pairs // Otherwise, assume that it's an object of key/value pairs
} else { } else {
// Serialize the key/values // Serialize the key/values
for ( var j in a ) for ( var j in a ) {
//if one value is array then treat each array value in part
if (typeof a[j] == 'object') {
for (var k = 0; k < a[j].length; k++) {
s.push( j + "[]=" + encodeURIComponent( a[j][k] ) );
}
} else {
s.push( j + "=" + encodeURIComponent( a[j] ) ); s.push( j + "=" + encodeURIComponent( a[j] ) );
} }
}
// Return the resulting serialization // Return the resulting serialization
return s.join("&"); return s.join("&");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment