success isn't successful, it just gets back the xml if successful or in the case of firefox, it seems to get a special parsererror (formatted as xml)!
I've removed all callbacks except complete, I have to do a lot of browser specific code to determine if the xml is malformed or the file is missing.
the final case is the actual success.
this is what I have so far:
<br style="font-family: courier new,monospace; font-weight: bold;"><span style="font-family: courier new,monospace; font-weight: bold;"> var surveyComplete = function(xrh, status){
</span><br style="font-family: courier new,monospace; font-weight: bold;"><span style="font-family: courier new,monospace; font-weight: bold;"> var xml = xrh.responseXML</span><br style="font-family: courier new,monospace; font-weight: bold;">
<span style="font-family: courier new,monospace; font-weight: bold;"> if (status!="success")</span><br style="font-family: courier new,monospace; font-weight: bold;"><span style="font-family: courier new,monospace; font-weight: bold;">
theSurvey</span><br style="font-family: courier new,monospace; font-weight: bold;"><span style="font-family: courier new,monospace; font-weight: bold;"> .append("<h1>" + status.toUpperCase
() + " requesting page " + url + "</h1>")</span><br style="font-family: courier new,monospace; font-weight: bold;"><span style="font-family: courier new,monospace; font-weight: bold;"> .append("<pre>" +
xrh.responseText + "</pre>")</span><br style="font-family: courier new,monospace; font-weight: bold;"><span style="font-family: courier new,monospace; font-weight: bold;"> else if (xml && xml.hasChildNodes
&& !xml.hasChildNodes())</span><br style="font-family: courier new,monospace; font-weight: bold;"><span style="font-family: courier new,monospace; font-weight: bold;"> form.html("<h1> broken xml </h1>")
</span><br style="font-family: courier new,monospace; font-weight: bold;"><span style="font-family: courier new,monospace; font-weight: bold;"> else if ( xml && xml.firstChild.nodeName == "parsererror")
</span><br style="font-family: courier new,monospace; font-weight: bold;"><span style="font-family: courier new,monospace; font-weight: bold;"> form.html($.xml(xml))</span><br style="font-family: courier new,monospace; font-weight: bold;">
<span style="font-family: courier new,monospace; font-weight: bold;"> else </span><br style="font-family: courier new,monospace; font-weight: bold;"><span style="font-family: courier new,monospace; font-weight: bold;">
surveyProcess(xml)</span><br style="font-family: courier new,monospace; font-weight: bold;"><span style="font-family: courier new,monospace; font-weight: bold;"> }</span><br style="font-family: courier new,monospace; font-weight: bold;">
<span style="font-family: courier new,monospace; font-weight: bold;"> $.ajax({url:url,datatype:'xml',complete:surveyComplete})</span><br style="font-family: courier new,monospace; font-weight: bold;">
<div>
<span class="gmail_quote">On 4/22/07, <b class="gmail_sendername">Klaus Hartl</b> <<a href="mailto:klaus.hartl@stilbuero.de">
klaus.hartl@stilbuero.de</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Ⓙⓐⓚⓔ schrieb:
> I use the error callback, but it doesn't get called back when the xml is
> malformed.
>
> Do I need to use the complete callback??
Yes, I think so. Or the success callback. The reason is, that the
response has been successfully delivered, just with ill-formed XML.
You may need a try/catch, but I don't know how browsers handle
ill-formed XML, e.g. if you can catch that error...
-- Klaus
</blockquote></div>
<br clear="all">
--
Ⓙⓐⓚⓔ - יעקב ʝǡǩȩ ᎫᎪᏦᎬ