Detecting server down on loadXML

I need to be able to detect if the server is down or if we’ve lost communication to the server. On normal AJAX requests I can look at loader.xmlDoc.responseText and detect a problem, showing the user a nice pop-up box.

However, when using loadXML, how can I detect if the server didn’t return any XML (eg, times out and returns “”)?

What is the preferred method to do this?

If server didn’t return any XML, “Icorrect XML” error will be thrown by the browser. You can catch this eror with dhtmlxError object:

dhtmlxError.catchError("LoadXML",function(a,b,data){ //data[0] - request object //data[0].responseText - incorrect server side response ... any kind of custom logic here ... });

Thank you, that worked! :smiley: