Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Bino on Jun 07, 2007 07:08
open dhtmlx forum
dhtmlxgrid error handling

After perusing through the forum I was able to view an information regarding error handling for Invalid XML request errors.

The info. I found directs me to use the following code:

function myErrorHandler(type,name,p){
.. ..
}

dhtmlxError.catchError("LoadXML",myErrorHandler);

The above worked fine - at first but here's the problem. When I generate a server defined error FF browser can handle the errors smoothly thus I was able to parse the xmlhttp response from my error handler but when I run my application using IE6, the error handler is not being invoked and a runtime script exception is thrown at the following function at dhtmlXGrid.js.

dhtmlXGridObject.prototype.parseXML = function(xml,startIndex){

.........
......
var pid=(top[0].getAttribute("parent")||0); /* Error points to this line which is being detected as null*/

}


It is obvious that the line would be null since I have thrown a user defined xml response to initiate the client side error handler. What confuses me is why Firefox was able to handle the error and IE cannot.
Answer posted on Jun 07, 2007 11:01
Did your server side response is correct XML ?
The loadXML error must fire only if incoming XML can't be correctly parsed. If it is correct there will not be error message in IE
( FF has slightly different way to work with XML, so in FF error will fire even if response is valid XML, but there is no "rows" tag in XML )

Answer posted on Jun 07, 2007 18:54
To prevent mentioned error in FF please made next modification in dhtmlxGrid.js ( it will be included in next build )

Please locate next string
    var top=this.xmlLoader.doXPath("//rows",xmlDoc);
and add after it
    if (!top) return;



Answer posted by Darya (Support) on Dec 04, 2014 13:38

To find more precise comments upon this issue, we can offer you read about rich user interface and free website templates.