deadseasquirrel
05-19-2004, 05:29 PM
My code is as follows (a snippet):
var newCity;
var newCenterName;
newCity = center.getElementsByTagName("city")[0].firstChild.nodeValue);
newCenterName = center.getElementsByTagName("name")[0].firstChild.nodeValue);
That above code does not work, but if I do:
alert(center.getElementsByTagName("city")[0].firstChild.nodeValue);
alert(center.getElementsByTagName("name")[0].firstChild.nodeValue);
works and it outputs the text. I am trying to save the text so I can use it in my javascript. But i am a real newbie at this XML stuff, can somebody give me a hand?
var newCity;
var newCenterName;
newCity = center.getElementsByTagName("city")[0].firstChild.nodeValue);
newCenterName = center.getElementsByTagName("name")[0].firstChild.nodeValue);
That above code does not work, but if I do:
alert(center.getElementsByTagName("city")[0].firstChild.nodeValue);
alert(center.getElementsByTagName("name")[0].firstChild.nodeValue);
works and it outputs the text. I am trying to save the text so I can use it in my javascript. But i am a real newbie at this XML stuff, can somebody give me a hand?