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:

   var surveyComplete = function(xrh, status){
       var xml = xrh.responseXML
       if (status!="success")
           theSurvey
               .append("<h1>" + status.toUpperCase() + " requesting page "
+ url + "</h1>")
               .append("<pre>" + xrh.responseText + "</pre>")
       else if (xml && xml.hasChildNodes && !xml.hasChildNodes())
           form.html("<h1> broken xml </h1>")
       else if ( xml && xml.firstChild.nodeName == "parsererror")
           form.html($.xml(xml))
       else
           surveyProcess(xml)
   }
   $.ajax({url:url,datatype:'xml',complete:surveyComplete})


On 4/22/07, Klaus Hartl <[EMAIL PROTECTED]> wrote:


Ⓙⓐⓚⓔ 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




--
Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ

Reply via email to