0

Hello,
i'm currently struggling to solve a very annoying issue that appeared when I was programming my HTML page
I'm getting an error in this function

function Tags()
{           

        if ( xmlHttpObj.readyState == 4 && xmlHttpObj.status == 200)
        {       

            var docXML = xmlHttpObj.responseXML;

            var tagsElem= docXML.getElementsByTagName("name");
            alert("check");
            var tags = new Array(tagsElem.length);
            var i;

            for(i=0; i<tagsElem.length; i++){
                var elem=tagsElem[i];
                tags[i] = elem.childNodes[0].nodeValue;
            }

            FillSelect(tags);
        }
}  

My XML is in the following format:

<person>
<name>Ben</name>
<age>23</age>
</person>

I have no idea why I'm not able to use the getElementsByTagName function, since the Check alert won't even pop up after I compile that call.

2
Contributors
1
Reply
2
Views
4 Years
Discussion Span
Last Post by adam.adamski.96155
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.