【发布时间】:2010-11-29 00:21:54
【问题描述】:
我正在尝试使用 Jquery 检查 xml 节点中的值是否存在。 xml字符串是:
<SectionAnswers>
<SectionAnswer>
<detailID>2216</detailID>
<SourceAnswerID>979</SourceAnswerID>
</SectionAnswer>
<SectionAnswer>
<detailID>2218</detailID>
<SourceAnswerID>981</SourceAnswerID>
</SectionAnswer>
<SectionAnswer>
<detailID>2219</detailID>
<SourceAnswerID>977</SourceAnswerID>
</SectionAnswer>
<SectionAnswer>
<detailID>2221</detailID>
<SourceAnswerID>980</SourceAnswerID>
</SectionAnswer>
<SectionAnswer>
<detailID>2282</detailID>
<SourceAnswerID>64</SourceAnswerID>
</SectionAnswer>
<SectionAnswer>
<detailID>2283</detailID>
<SourceAnswerID>978</SourceAnswerID>
</SectionAnswer>
<SectionAnswer>
<detailID>2596</detailID>
<SourceAnswerID>73</SourceAnswerID>
</SectionAnswer>
</SectionAnswers>
当我尝试使用以下方法查询它的值时:
$("SectionAnswers", Section).find("64") //Section是jquery上下文
我收到以下回复:
表达式不返回 DOM 节点。
.//-->64
有什么想法我会出错吗?我真的不想像在 $("SectionAnswers", Section).each() 中那样每次循环检查值
谢谢
【问题讨论】: