MCPcopy Create free account
hub / github.com/HtmlUnit/htmlunit / add

Function add

src/test/resources/libraries/jQuery/3.3.1/jquery/src/serialize.js:62–71  ·  view source on GitHub ↗
( key, valueOrFunction )

Source from the content-addressed store, hash-verified

60 var prefix,
61 s = [],
62 add = function( key, valueOrFunction ) {
63
64 // If value is a function, invoke it and use its return value
65 var value = isFunction( valueOrFunction ) ?
66 valueOrFunction() :
67 valueOrFunction;
68
69 s[ s.length ] = encodeURIComponent( key ) + "=" +
70 encodeURIComponent( value == null ? "" : value );
71 };
72
73 // If an array was passed in, assume that it is an array of form elements.
74 if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {

Callers 3

callbacks.jsFile · 0.70
buildParamsFunction · 0.70
serialize.jsFile · 0.70

Calls 1

isFunctionFunction · 0.50

Tested by

no test coverage detected