mirror of
https://github.com/jquery/jquery.git
synced 2026-02-01 05:25:16 -05:00
Serialize: Treat literal and function-returned null/undefined the same
Fixes gh-3005 Closes gh-3007
This commit is contained in:
committed by
Richard Gibson
parent
5d20a3c3f1
commit
9fdbdd393a
@@ -58,7 +58,10 @@ jQuery.param = function( a, traditional ) {
|
||||
add = function( key, value ) {
|
||||
|
||||
// If value is a function, invoke it and return its value
|
||||
value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
|
||||
value = jQuery.isFunction( value ) ? value() : value;
|
||||
if ( value == null ) {
|
||||
value = "";
|
||||
}
|
||||
s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user