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.

I wrapped your code in an ajax function, and made the xml file, and it alerted Ben on all three browsers (IE, FF, Chrome) - http://www.zigstum.com/randoquote/dani.php
Do you have no error console to debug javascript?

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.