diff options
author | SCWR <dl_run@qq.com> | 2021-06-29 14:49:30 +0800 |
---|---|---|
committer | Irvin <irvinfly@gmail.com> | 2021-07-02 14:51:35 +0800 |
commit | 04449b4dcacaa0d936989b572b6b43ed37e2d1bb (patch) | |
tree | d9d49e3799e99e069006039a86c6830cb5e2df5f | |
parent | 38dba1560ad332820179aa8a567b5f13334ca074 (diff) | |
download | translated-content-04449b4dcacaa0d936989b572b6b43ed37e2d1bb.tar.gz translated-content-04449b4dcacaa0d936989b572b6b43ed37e2d1bb.tar.bz2 translated-content-04449b4dcacaa0d936989b572b6b43ed37e2d1bb.zip |
Update index.html
translation
-rw-r--r-- | files/zh-cn/web/xpath/introduction_to_using_xpath_in_javascript/index.html | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/files/zh-cn/web/xpath/introduction_to_using_xpath_in_javascript/index.html b/files/zh-cn/web/xpath/introduction_to_using_xpath_in_javascript/index.html index d72b2fdfe7..8821b1dcb4 100644 --- a/files/zh-cn/web/xpath/introduction_to_using_xpath_in_javascript/index.html +++ b/files/zh-cn/web/xpath/introduction_to_using_xpath_in_javascript/index.html @@ -66,7 +66,7 @@ original_slug: Web/JavaScript/Introduction_to_using_XPath_in_JavaScript <pre class="brush: js">var nsResolver = document.createNSResolver( contextNode.ownerDocument == null ? contextNode.documentElement : contextNode.ownerDocument.documentElement ); </pre> -<p><span class="comment">Or alternatively by using the <code>createNSResolver</code> method of a <code>XPathEvaluator</code> object. <pre> var xpEvaluator = new XPathEvaluator(); var nsResolver = xpEvaluator.createNSResolver( contextNode.ownerDocument == null ? contextNode.documentElement : contextNode.ownerDocument.documentElement ); </pre></span></p> +<p><span class="comment">或者,也可以使用 <code>XPathEvaluator</code> 对象的 <code>createNSResolver</code> 方法。<pre> var xpEvaluator = new XPathEvaluator(); var nsResolver = xpEvaluator.createNSResolver( contextNode.ownerDocument == null ? contextNode.documentElement : contextNode.ownerDocument.documentElement ); </pre></span></p> <p>然后传递 <code>document.evaluate</code>,将 <code>nsResolver</code> 变量作为 <code>namespaceResolver</code> 参数。</p> |