Changeset 5703
- Timestamp:
- 05/28/08 02:50:38 (8 months ago)
- Files:
-
- 1 modified
-
trunk/jquery/src/ajax.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/jquery/src/ajax.js
r5701 r5703 487 487 // key/values into a query string 488 488 param: function( a ) { 489 var s = []; 489 var s = [ ]; 490 491 function add( key, value ){ 492 s[ s.length ] = encodeURIComponent(key) + '=' + encodeURIComponent(value); 493 }; 490 494 491 495 // If an array was passed in, assume that it is an array … … 494 498 // Serialize the form elements 495 499 jQuery.each( a, function(){ 496 s.push( encodeURIComponent(this.name) + "=" + encodeURIComponent( this.value ));500 add( this.name, this.value ); 497 501 }); 498 502 … … 504 508 if ( a[j] && a[j].constructor == Array ) 505 509 jQuery.each( a[j], function(){ 506 s.push( encodeURIComponent(j) + "=" + encodeURIComponent( this ));510 add( j, this ); 507 511 }); 508 512 else 509 s.push( encodeURIComponent(j) + "=" + encodeURIComponent( jQuery.isFunction(a[j]) ? a[j]() : a[j] ));513 add( j, jQuery.isFunction(a[j]) ? a[j]() : a[j] ); 510 514 511 515 // Return the resulting serialization
