使用Javascript获取XML节点值

使用Javascript获取XML节点值,javascript,xml,ajax,nodevalue,Javascript,Xml,Ajax,Nodevalue,我试图弄清楚如何在Javascript中获取节点的值。我读过一些教程,但它们使用的示例都比我正在做的要复杂得多 这是我的Javascript if(xmlhttpp.readyState==4 && xmlhttpp.status==200){ document.getElementById("ajax_status").innerHTML=xmlhttpp.responseXML.getElementsByTagName('status'

我试图弄清楚如何在Javascript中获取节点的值。我读过一些教程,但它们使用的示例都比我正在做的要复杂得多

这是我的Javascript

        if(xmlhttpp.readyState==4 && xmlhttpp.status==200){
            document.getElementById("ajax_status").innerHTML=xmlhttpp.responseXML.getElementsByTagName('status').nodeValue;
        }
XML是

<?xml version='1.0' encoding='UTF-8'?>
<resp><fname>Kyla</fname>
<lname>Bonds</lname>
<addr>6916 S Elizabeth Street</addr>
<city>Chicago</city>
<street>IL</street>
<zip>60636</zip>
<phone></phone>
<email>Kbonds20@gmail.com</email>
<status>Found user</status></resp>

凯拉
债券
伊利沙伯街6916 S
芝加哥
白细胞介素
60636
Kbonds20@gmail.com
发现用户
如何从中获取“找到的用户”?

试试看

xmlhttpp.responseXML.getElementsByTagName('status')[0].firstChild.nodeValue

只是一个很小的问题,并不是对您的问题的回答,但该对象通常被称为xmlhttp,而不是xmlhttpp。