XML DOM » Document » parseError

Compability: Internet Explorer

Syntax:
document.parseError

This property returns an XMLDOMParseError object containing information about the last parse error. prefix Property This property is read-only and returns the namespace prefix, or an empty string if none is specified. For example, it would return 'xxx' for the element xxx:yyy.

Examples

Code:
xml_doc = new ActiveXObject("Microsoft.XMLDOM");
xml_doc.async = false;
xml_doc.load("albums.xml");
err = xml_doc.parseError;
if (err.errorCode != 0) alert("Error: " + err.reason);
Explanation:

In this example the parseError property is used to create an XMLDOMParseError object after loading the XML file. Then the errorCode property is used to determine whether an error has occurred, and if so, a warning message is displayed.

Language(s): JavaScript