K
Kevin
Hello,
My code (shown below) tries to access the value of an XML element.
After I declare the variable "name" equal to "dog," I then create a
new variable, a, that gets all elements named "dog." Next, my
if...else statement is true for the if statement with this output:
"found name dog with length = 1"
Next, I try to access the first child node of all elements named
"dog." On this line my code fails with an
"xmlDoc.getElementsByTagName(name).childNodes[0]; not defined" error.
var name = "dog";
var a = xmlDoc.getElementsByTagName(name);
if(a) {alert("found name " + name + "with length = " + a.length);}
else {alert(QuoteName + " not found");}
var b = xmlDoc.getElementsByTagName(name).childNodes[0]; //
6-27-2010: undefined error
Please let me know your thoughts.
Thank you,
Kevin
My code (shown below) tries to access the value of an XML element.
After I declare the variable "name" equal to "dog," I then create a
new variable, a, that gets all elements named "dog." Next, my
if...else statement is true for the if statement with this output:
"found name dog with length = 1"
Next, I try to access the first child node of all elements named
"dog." On this line my code fails with an
"xmlDoc.getElementsByTagName(name).childNodes[0]; not defined" error.
var name = "dog";
var a = xmlDoc.getElementsByTagName(name);
if(a) {alert("found name " + name + "with length = " + a.length);}
else {alert(QuoteName + " not found");}
var b = xmlDoc.getElementsByTagName(name).childNodes[0]; //
6-27-2010: undefined error
Please let me know your thoughts.
Thank you,
Kevin