Serialize: Reduce size

Ref 9fdbdd393a
This commit is contained in:
Richard Gibson
2016-04-05 10:54:37 -04:00
parent 9fdbdd393a
commit 91850ecbbe

View File

@@ -55,14 +55,15 @@ function buildParams( prefix, obj, traditional, add ) {
jQuery.param = function( a, traditional ) {
var prefix,
s = [],
add = function( key, value ) {
add = function( key, valueOrFunction ) {
// If value is a function, invoke it and return its value
value = jQuery.isFunction( value ) ? value() : value;
if ( value == null ) {
value = "";
}
s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
// If value is a function, invoke it and use its return value
var value = jQuery.isFunction( valueOrFunction ) ?
valueOrFunction() :
valueOrFunction;
s[ s.length ] = encodeURIComponent( key ) + "=" +
encodeURIComponent( value == null ? "" : value );
};
// Set traditional to true for jQuery <= 1.3.2 behavior.