X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fajax.js;h=7b15a1d80f358b4fa296767df322f90939e6b77c;hb=94d925cd4615d88532737f3cd106ecd1f8c34bc3;hp=d0c6752788db5d7b68a657241ab354716cb14030;hpb=ca90ffb332eafc93b8107aeb2afa7473132392fd;p=jquery.git diff --git a/src/ajax.js b/src/ajax.js index d0c6752..7b15a1d 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -6,15 +6,15 @@ var jsc = now(), rquery = /\?/, rts = /(\?|&)_=.*?(&|$)/, rurl = /^(\w+:)?\/\/([^\/?#]+)/, - r20 = /%20/g; + r20 = /%20/g, -jQuery.fn.extend({ - // Keep a copy of the old load - _load: jQuery.fn.load, + // Keep a copy of the old load method + _load = jQuery.fn.load; +jQuery.fn.extend({ load: function( url, params, callback ) { if ( typeof url !== "string" ) { - return this._load( url ); + return _load.call( this, url ); // Don't do a request if no elements are being requested } else if ( !this.length ) { @@ -635,7 +635,7 @@ jQuery.extend({ if ( jQuery.isArray(obj) ) { // Serialize array item. jQuery.each( obj, function( i, v ) { - if ( traditional ) { + if ( traditional || /\[\]$/.test( prefix ) ) { // Treat each array item as a scalar. add( prefix, v ); } else {