| 7366 | }; |
| 7367 | |
| 7368 | function buildParams( prefix, obj, traditional, add ) { |
| 7369 | var name; |
| 7370 | |
| 7371 | if ( jQuery.isArray( obj ) ) { |
| 7372 | // Serialize array item. |
| 7373 | jQuery.each( obj, function( i, v ) { |
| 7374 | if ( traditional || rbracket.test( prefix ) ) { |
| 7375 | // Treat each array item as a scalar. |
| 7376 | add( prefix, v ); |
| 7377 | |
| 7378 | } else { |
| 7379 | // Item is non-scalar (array or object), encode its numeric index. |
| 7380 | buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add ); |
| 7381 | } |
| 7382 | }); |
| 7383 | |
| 7384 | } else if ( !traditional && jQuery.type( obj ) === "object" ) { |
| 7385 | // Serialize object item. |
| 7386 | for ( name in obj ) { |
| 7387 | buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); |
| 7388 | } |
| 7389 | |
| 7390 | } else { |
| 7391 | // Serialize scalar item. |
| 7392 | add( prefix, obj ); |
| 7393 | } |
| 7394 | } |
| 7395 | jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + |
| 7396 | "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + |
| 7397 | "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) { |