To make jQuery return the elements from the first , like the XPath sample in Listing 4, you have to instruct it to use the first it finds (see Listing 6).
要让jQuery 跟清单4中的XPath样例一样返回第一个中的元素,您必须指导它使用它找到的第一个 (参见 清单6)。
Selectors: Get a complete list of all the selectors you can use with jQuery, including CSS3 and XPath selectors.
选择器:获取在jQuery中可以使用的选择器的完整列表,包括CSS3和XPath选择器。
Both XPath and jQuery support straightforward traversal semantics for matching element nodes in relation to the currently matched element.
对于匹配与当前匹配的元素相关的元素节点,XPath和jQuery都支持直观的遍历语义。
Both XPath and jQuery let you combine more than one selector to retrieve every node that matches any of the queries (that is, you'll get the union of the results).
XPath和jQuery都允许您组合多个选择器来检索每个匹配任意查询的节点(就是说,将得到结果的并集)。
XPath and jQuery have powerful querying semantics for selecting nodes from well-formed XML documents, including XHTML pages.
对于从格式良好的XML文档(包括xhtml页面)选择节点,XPath和jQuery具有强大的查询语义。
Note that I've used: first in the jQuery sample to make it work exactly like the XPath version.
注意,我在jQuery样例中使用了:first,以使它的行为完全跟XPath版本一样。
You should now be well on your way to understanding when and how to use XPath 1.0 and jQuery 1.4 for similar tasks.
您现在应该比较能理解何时以及如何将XPath 1.0和jQuery 1.4用于类似的任务了。
The fundamental purpose of both XPath and jQuery is to select nodes from a document.
XPath和jQuery的基本目的都是从文档选择节点。
The fundamental purpose of both XPath and jQuery is to select nodes from a document.
XPath和jQuery的基本目的都是从文档选择节点。
应用推荐