Opened 16 years ago
Closed 16 years ago
#1145 closed bug (fixed)
error callback does not get called for many errors
Reported by: | jakecigar | Owned by: | john |
---|---|---|---|
Priority: | major | Milestone: | 1.1.4 |
Component: | ajax | Version: | 1.1.3 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description (last modified by )
I assumed (incorrectly) that the error callback would be called for malformed xml. it is not. I've had to code around this with the complete callback.
I can now catch safari(webkit), firefox 2 & opera 9, I have no idea what IE will do.
var surveyComplete = function(xrh, status){
var xml = xrh.responseXML if (status!="success")
form.html("<h1>" + status.toUpperCase() + " requesting:<a href='" + url + "'>" + url +"</a></h1>")
.append("<pre>" + xrh.responseText + "</pre>")
else if (!xml) safari webkit
form.text(xrh.responseText).wrap("<pre></pre>")
.prepend("<h1> broken xml:<a href='" + url + "'>" + url +"</a> </h1>")
else if (xml.hasChildNodes && !xml.hasChildNodes()) opera
form.text(xrh.responseText).wrap("<pre></pre>")
.prepend("<h1> broken xml:<a href='" + url + "'>" + url +"</a> </h1>")
else if (xml.firstChild.nodeName == "parsererror") firefox
form.text(xrh.responseText).wrap("<pre></pre>")
.prepend("<h1> broken xml:<a href='" + url + "'>" + url +"</a> </h1>"+ $.xml(xml))
else
surveyProcess(xml)
} $.ajax({url:url,datatype:'xml',complete:surveyComplete})
Change History (3)
comment:1 Changed 16 years ago by
comment:2 Changed 16 years ago by
Description: | modified (diff) |
---|---|
Milestone: | 1.1.3 → 1.1.4 |
Owner: | set to john |
Version: | 1.1.2 → 1.1.3 |
I use similar logic in the Taconite plugin when converting a string to a document: