Side navigation
Ticket #1541: xml_parse_error_skipped_when_request_body_is_blank.diff
File xml_parse_error_skipped_when_request_body_is_blank.diff, 0.6 KB (added by gbuesing, August 27, 2007 03:44AM UTC)
Index: jquery/src/ajax/ajax.js
===================================================================
--- jquery/src/ajax/ajax.js (revision 2919)
+++ jquery/src/ajax/ajax.js (working copy)
@@ -795,7 +795,7 @@
var xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0;
data = xml ? r.responseXML : r.responseText;
- if ( xml && data.documentElement.tagName == "parsererror" )
+ if ( xml && r.responseText.match(/\S/) && data.documentElement.tagName == "parsererror" )
throw "parsererror";
// If the type is "script", eval it in global context
Download in other formats:
Original Format
File xml_parse_error_skipped_when_request_body_is_blank.diff, 0.6 KB (added by gbuesing, August 27, 2007 03:44AM UTC)
Index: jquery/src/ajax/ajax.js
===================================================================
--- jquery/src/ajax/ajax.js (revision 2919)
+++ jquery/src/ajax/ajax.js (working copy)
@@ -795,7 +795,7 @@
var xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0;
data = xml ? r.responseXML : r.responseText;
- if ( xml && data.documentElement.tagName == "parsererror" )
+ if ( xml && r.responseText.match(/\S/) && data.documentElement.tagName == "parsererror" )
throw "parsererror";
// If the type is "script", eval it in global context