X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fajax.js;h=f514caee73bcdb9d864b547fc0e3abef08c39fea;hb=8a66a30fece5db98a5f606b11c15fef1016d045a;hp=4af502a9780b510b66b665973d06905e232648b6;hpb=1a14a38ff77839b2a71fbc3f3c0890ebe62438c7;p=jquery.git diff --git a/src/ajax.js b/src/ajax.js index 4af502a..f514cae 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -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 @@ -621,7 +624,7 @@ jQuery.extend({ // If traditional, encode the "old" way (the way 1.3.2 or older // did it), otherwise encode params recursively. for ( var prefix in a ) { - buildParams( prefix, a[prefix] ); + buildParams( traditional ? prefix : prefix.replace(/[\[\]]/g, ""), a[prefix] ); } }