var s = jQuery.extend(true, {}, jQuery.ajaxSettings, origSettings);
var jsonp, status, data,
- callbackContext = s.context || s,
+ callbackContext = origSettings && origSettings.context || s,
type = s.type.toUpperCase();
// convert data if not already a string
});
});
+test("jQuery.ajax context modification", function() {
+ expect(1);
+
+ stop();
+
+ var obj = {}
+
+ jQuery.ajax({
+ url: url("data/name.html"),
+ context: obj,
+ beforeSend: function(){
+ this.test = "foo";
+ },
+ complete: function() {
+ start();
+ }
+ });
+
+ equals( obj.test, "foo", "Make sure the original object is maintained." );
+});
+
test("jQuery.ajax() - disabled globals", function() {
expect( 3 );
stop();