如何使用javascript访问特定节点下的xml节点? 约翰 test@test.com 一些文本 1. 自动测试系统 some@test.ee 伟大的网站! 0
您好,我正在尝试使用Javascript访问xml节点。有谁能解释一下如何访问该证明下的所有节点(id='4c050652f0c3e') 谢谢。在jquery中使用选择器如何使用javascript访问特定节点下的xml节点? 约翰 test@test.com 一些文本 1. 自动测试系统 some@test.ee 伟大的网站! 0,javascript,jquery,xml,Javascript,Jquery,Xml,您好,我正在尝试使用Javascript访问xml节点。有谁能解释一下如何访问该证明下的所有节点(id='4c050652f0c3e') 谢谢。在jquery中使用选择器 <testimonials> <testimonial id="4c050652f0c3e"> <nimi>John</nimi> <email>test@test.com</email> <text>Some text
<testimonials>
<testimonial id="4c050652f0c3e">
<nimi>John</nimi>
<email>test@test.com</email>
<text>Some text</text>
<active>1</active>
</testimonial>
<testimonial id="4c05085e1cd4f">
<name>ats</name>
<email>some@test.ee</email>
<text>Great site!</text>
<active>0</akctive>
</testimonial> </testimonials>
那么你必须使用直接id
$("[category=cooking]").children().each(function(){
alert($(this).text());
});
谢谢,这很有效。你能用Javascript给我解释一下吗?谢谢你的帮助。@user3891074 Javascript和jquery相比有点复杂,jquery支持所有的现代浏览器,而且我也不完全了解Javascript,使用jquery是最好的
$("#4c050652f0c3e").children().each(function () {
alert($(this).text());
});