jQuery.ajax modified the passed-in object only to help test the code - this shouldn...
[jquery.git] / src / ajax.js
index 1cb7ee5..a9f47dd 100644 (file)
@@ -194,7 +194,7 @@ jQuery.extend({
        ajax: function( s ) {
                // Extend the settings, but re-extend 's' so that it can be
                // checked again later (in the test suite, specifically)
-               s = jQuery.extend(true, s, jQuery.extend(true, {}, jQuery.ajaxSettings, s));
+               s = jQuery.extend(true, {}, jQuery.ajaxSettings, s);
                
                var jsonp, status, data,
                        callbackContext = s.context || window,
@@ -457,6 +457,8 @@ jQuery.extend({
                        xhr.send( type === "POST" || type === "PUT" ? s.data : null );
                } catch(e) {
                        jQuery.handleError(s, xhr, null, e);
+                       // Fire the complete handlers
+                       complete();
                }
 
                // firefox 1.5 doesn't fire statechange for sync requests