X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fajax.js;h=d92d26d15ae1e6522e4e9973033ec24bd391afcc;hb=c639405c4d1ec462b032ccfb571a6c73212ba101;hp=552d412f4ad5a0235e03c9f037eadcbd446cdb1f;hpb=6a3d0996edf2f8ba69f62c8c7c3eda07b674d81f;p=jquery.git diff --git a/src/ajax.js b/src/ajax.js index 552d412..d92d26d 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -45,18 +45,19 @@ jQuery.fn.extend({ } } + var self = this; + // Request the remote document jQuery.ajax({ url: url, type: type, dataType: "html", data: params, - context:this, complete: function( res, status ) { // If successful, inject the HTML into all the matched elements if ( status === "success" || status === "notmodified" ) { // See if a selector was specified - this.html( selector ? + self.html( selector ? // Create a dummy div to hold the results jQuery("
") // inject the contents of the document in, removing the scripts @@ -71,7 +72,7 @@ jQuery.fn.extend({ } if ( callback ) { - this.each( callback, [res.responseText, status, res] ); + self.each( callback, [res.responseText, status, res] ); } } });