Skip to content
Permalink
Browse files

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

…in part
  • Loading branch information
stefanpetre committed Nov 16, 2006
1 parent 32816ef commit 317ea5caeacdae60ef759fd1e35c9219c9e14c87
Showing with 9 additions and 2 deletions.
  1. +9 −2 src/ajax/ajax.js
@@ -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

0 comments on commit 317ea5c

Please sign in to comment.
You can’t perform that action at this time.