( prefix, obj, traditional, add )
| 8883 | rsubmittable = /^(?:input|select|textarea|keygen)/i; |
| 8884 | |
| 8885 | function buildParams( prefix, obj, traditional, add ) { |
| 8886 | var name; |
| 8887 | |
| 8888 | if ( Array.isArray( obj ) ) { |
| 8889 | |
| 8890 | // Serialize array item. |
| 8891 | jQuery.each( obj, function( i, v ) { |
| 8892 | if ( traditional || rbracket.test( prefix ) ) { |
| 8893 | |
| 8894 | // Treat each array item as a scalar. |
| 8895 | add( prefix, v ); |
| 8896 | |
| 8897 | } else { |
| 8898 | |
| 8899 | // Item is non-scalar (array or object), encode its numeric index. |
| 8900 | buildParams( |
| 8901 | prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", |
| 8902 | v, |
| 8903 | traditional, |
| 8904 | add |
| 8905 | ); |
| 8906 | } |
| 8907 | } ); |
| 8908 | |
| 8909 | } else if ( !traditional && toType( obj ) === "object" ) { |
| 8910 | |
| 8911 | // Serialize object item. |
| 8912 | for ( name in obj ) { |
| 8913 | buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); |
| 8914 | } |
| 8915 | |
| 8916 | } else { |
| 8917 | |
| 8918 | // Serialize scalar item. |
| 8919 | add( prefix, obj ); |
| 8920 | } |
| 8921 | } |
| 8922 | |
| 8923 | // Serialize an array of form elements or a set of |
| 8924 | // key/values into a query string |
no test coverage detected