X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fajax.js;h=d0c6752788db5d7b68a657241ab354716cb14030;hb=eed69eccc54d010889b5d8495320538d7ceb4e51;hp=ee52ed82f5e75bcb9161aa4a02fc2203daa59271;hpb=f91b944cabf7be9aadb40ffe35fce76b50f5f25f;p=jquery.git diff --git a/src/ajax.js b/src/ajax.js index ee52ed8..d0c6752 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -206,7 +206,7 @@ jQuery.extend({ 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 @@ -417,13 +417,16 @@ jQuery.extend({ "notmodified" : "success"; + var errMsg; + if ( status === "success" ) { // Watch for, and catch, XML document parse errors try { // process the data (runs the xml through httpData regardless of callback) data = jQuery.httpData( xhr, s.dataType, s ); - } catch(e) { + } catch(err) { status = "parsererror"; + errMsg = err; } } @@ -434,7 +437,7 @@ jQuery.extend({ success(); } } else { - jQuery.handleError(s, xhr, status); + jQuery.handleError(s, xhr, status, errMsg); } // Fire the complete handlers