X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fajax.js;h=e0ab7f483c608c365980e7d417292bced0c9921a;hb=99101e02f957087410cc0b5837ef09e3dfa12466;hp=b089f22c29cad7858a7b576854dd62a9e2960fd8;hpb=17b1e407d101c5c7f91db633df3a80cd9b4466ae;p=jquery.git diff --git a/src/ajax.js b/src/ajax.js index b089f22..e0ab7f4 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -1,7 +1,10 @@ jQuery.fn.extend({ + // Keep a copy of the old load + _load: jQuery.fn.load, + load: function( url, params, callback ) { - if ( jQuery.isFunction( url ) ) - return this.bind("load", url); + if ( typeof url != 'string' ) + return this._load( url ); var off = url.indexOf(" "); if ( off >= 0 ) { @@ -489,7 +492,7 @@ jQuery.extend({ s.push( encodeURIComponent(j) + "=" + encodeURIComponent( this ) ); }); else - s.push( encodeURIComponent(j) + "=" + encodeURIComponent( a[j] ) ); + s.push( encodeURIComponent(j) + "=" + encodeURIComponent( jQuery.isFunction(a[j]) ? a[j]() : a[j] ) ); // Return the resulting serialization return s.join("&").replace(/%20/g, "+");