X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fajax.js;h=697365a2ff232bb94fa79654e7ea12f5ba5e055f;hb=ac00fe5bbb2a95fdb747f76fd9dd7c58ba6a531c;hp=a9f47ddb27300831c3c99f23d1d8f6c1785b7a74;hpb=6a722e251dedd5f01ac0c46e330a368be7bb760b;p=jquery.git diff --git a/src/ajax.js b/src/ajax.js index a9f47dd..697365a 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -15,6 +15,10 @@ jQuery.fn.extend({ load: function( url, params, callback ) { if ( typeof url !== "string" ) { return this._load( url ); + + // Don't do a request if no elements are being requested + } else if ( !this.length ) { + return this; } var off = url.indexOf(" "); @@ -469,7 +473,7 @@ jQuery.extend({ function success(){ // If a local callback was specified, fire it and pass it the data if ( s.success ) { - s.success.call( callbackContext, data, status ); + s.success.call( callbackContext, data, status, xhr ); } // Fire the global callback