Home | Top | Free Ajax Editor | JavaScript Editor | Get Advanced JavaScript and Ajax Editor, Validator and Debugger! 1st JavaScript Editor. |
Loads an XML document using the supplied string.
boolValue = oXMLDOMDocument.loadXML(bstrXML);
Boolean. Returns True if the XML load succeeded. Returns False and sets the documentElement
property of the DOMDocument
to Null if the XML load failed.
The following script example creates a DOMDocument
object, and then uses its loadXML
method to load the specified XML before displaying it.
var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.4.0");
xmlDoc.async = false;
xmlDoc.resolveExternals = false;
xmlDoc.loadXML("<customer><first_name>Joe</first_name><last_name>Smith</last_name></customer>");
if (xmlDoc.parseError.errorCode <> 0) {
var myErr = xmlDoc.parseError
alert("You have error " + myErr.reason); }
else { alert(xmlDoc.xml); }
Calling load
or loadXML
on an existing document immediately discards the content of the document. The loadXML()
method will work only with UTF-16 or UCS-2 encodings.
This member is an extension of the Worldwide Web Consortium (W3C) Document Object Model (DOM).
Home | Top | Free Ajax Editor | JavaScript Editor | Get Advanced JavaScript and Ajax Editor, Validator and Debugger! 1st JavaScript Editor. |