【发布时间】:2011-10-05 04:46:58
【问题描述】:
Android 浏览器不支持 XpathEvaluator 对象。
我正在尝试用 JQuery 替换 Xpath。
例如,
01. oRoot.selectSingleNode("step/person");
-> $(oRoot).find("step person");
02. oRoot.selectSingleNode("step/person[@color='red' and age='20']");
-> $(oRoot).find("step person[color='red'][age=[20]");
但是,我不知道下面的代码怎么改?
01. oRoot.selectSingleNode("step/person[@color='red' or @color='black']");
02. oRoot.selectSingleNode("step/person[taskinfo/status='holding']");
你知道对 jQuery 代码应用 OR 操作吗?
你知道对 jQuery 代码应用一个深度属性吗?
或者你有其他好的解决方案吗?
【问题讨论】:
标签: javascript jquery android xpath selectsinglenode