| 7525 | }; |
| 7526 | |
| 7527 | function buildParams( prefix, obj, traditional, add ) { |
| 7528 | var name; |
| 7529 | |
| 7530 | if ( jQuery.isArray( obj ) ) { |
| 7531 | // Serialize array item. |
| 7532 | jQuery.each( obj, function( i, v ) { |
| 7533 | if ( traditional || rbracket.test( prefix ) ) { |
| 7534 | // Treat each array item as a scalar. |
| 7535 | add( prefix, v ); |
| 7536 | |
| 7537 | } else { |
| 7538 | // Item is non-scalar (array or object), encode its numeric index. |
| 7539 | buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add ); |
| 7540 | } |
| 7541 | }); |
| 7542 | |
| 7543 | } else if ( !traditional && jQuery.type( obj ) === "object" ) { |
| 7544 | // Serialize object item. |
| 7545 | for ( name in obj ) { |
| 7546 | buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); |
| 7547 | } |
| 7548 | |
| 7549 | } else { |
| 7550 | // Serialize scalar item. |
| 7551 | add( prefix, obj ); |
| 7552 | } |
| 7553 | } |
| 7554 | jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + |
| 7555 | "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + |
| 7556 | "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) { |