Thanks @blq (Fredrik Blomqvist)
Fixes gh-3035
Close gh-3039
// If it fails, this function gets "jqXHR", "status", "error"
} ).always( callback && function( jqXHR, status ) {
self.each( function() {
- callback.apply( self, response || [ jqXHR.responseText, status, jqXHR ] );
+ callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );
} );
} );
}
}
);
+ QUnit.test(
+ "jQuery#load() - should resolve with correct context", 2,
+ function( assert ) {
+ var done = assert.async();
+ var ps = jQuery( "<p></p><p></p>" );
+ var i = 0;
+
+ ps.appendTo( "#qunit-fixture" );
+
+ ps.load( "data/ajax/method.php", function() {
+ assert.strictEqual( this, ps[ i++ ] );
+
+ if ( i === 2 ) {
+ done();
+ }
+ } );
+ }
+ );
+
QUnit.test(
"#11402 - jQuery.domManip() - script in comments are properly evaluated", 2,
function( assert ) {