mirror of
https://github.com/jquery/jquery.git
synced 2026-02-06 06:15:03 -05:00
if one value of key/value pairs is array then treat each array value in part
This commit is contained in:
@@ -892,8 +892,15 @@ jQuery.extend({
|
||||
// Otherwise, assume that it's an object of key/value pairs
|
||||
} else {
|
||||
// Serialize the key/values
|
||||
for ( var j in a )
|
||||
s.push( j + "=" + encodeURIComponent( a[j] ) );
|
||||
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] ) );
|
||||
}
|
||||
}
|
||||
|
||||
// Return the resulting serialization
|
||||
|
||||
Reference in New Issue
Block a user