I am trying to do XML enumeration and have run into an error that I can't seem to fix. When I try to shove "Blah" from the XML into the playerName variable, I keep getting "Error: Object required". I have posted the relevant sections of code below.
Also, I'm not even sure if the script is loading the file correctly. Is there a way that I can tell if it loaded?
XML:
code:
<root>
<player>
<name>Blah</name>
</player>
</root>
JScript:
code:
function loadXML(fileName) {
// Create the XML object
var XML = new ActiveXObject ('MSXML.DOMDocument') ;
XML.async = false;
XML.load(fileName);
var playerName = XML.selectSingleNode('/player/name').nodeValue;
}