I have a bunch of code

var xmlDoc = new ActiveXObject("MSXML2.DOMDocument.3.0");
    xmlDoc.async=false;
    xmlDoc.loadXML(sHTTP);
    
    var rootElement = new String(xmlDoc.documentElement.Name);
    Response.Write(rootElement);

The problem is that when I try to display the rootElement Node Name, it appears as 'undefined' on my browser. I also tried xmlDoc.documentElement.NodeName.

Any help will be greatly appreciated.

Thanks

...also tried xmlDoc.documentElement.NodeName.

Try lowercase "N" for Node
xmlDoc.documentElement.nodeName.

If the problem persists, verify that the document loaded correctly - on line 4 put: Response.Write(xmlDoc.xml); If you do not see the xml document, then it was not retrieved.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.