From 8d7ad7715e19a445def22de6d5f3d9519cebe69e Mon Sep 17 00:00:00 2001 From: MDN Date: Wed, 24 Mar 2021 00:27:57 +0000 Subject: [CRON] sync translated content --- files/zh-cn/web/api/node/localname/index.html | 64 ----------- files/zh-cn/web/api/node/namespaceuri/index.html | 138 ----------------------- files/zh-cn/web/api/node/prefix/index.html | 76 ------------- 3 files changed, 278 deletions(-) delete mode 100644 files/zh-cn/web/api/node/localname/index.html delete mode 100644 files/zh-cn/web/api/node/namespaceuri/index.html delete mode 100644 files/zh-cn/web/api/node/prefix/index.html (limited to 'files/zh-cn/web/api/node') diff --git a/files/zh-cn/web/api/node/localname/index.html b/files/zh-cn/web/api/node/localname/index.html deleted file mode 100644 index de9dcc4680..0000000000 --- a/files/zh-cn/web/api/node/localname/index.html +++ /dev/null @@ -1,64 +0,0 @@ ---- -title: Node.localName -slug: Web/API/Node/localName -translation_of: Web/API/Node/localName ---- -
- {{ApiRef}}
-

Summary

-

Returns the local part of the qualified name of this node.

-

Syntax

-
name = element.localName
-
- -

Example

-

(Must be served with XML content type, such as text/xml or application/xhtml+xml.)

-
<html xmlns="http://www.w3.org/1999/xhtml"
-      xmlns:svg="http://www.w3.org/2000/svg">
-<head>
-  <script type="application/javascript"><![CDATA[
-  function test() {
-    var text = document.getElementById('text');
-    var circle = document.getElementById('circle');
-
-    text.value = "<svg:circle> has:\n" +
-                 "localName = '" + circle.localName + "'\n" +
-                 "namespaceURI = '" + circle.namespaceURI + "'";
-  }
-  ]]></script>
-</head>
-<body onload="test()">
-  <svg:svg version="1.1"
-    width="100px" height="100px"
-    viewBox="0 0 100 100">
-    <svg:circle cx="50" cy="50" r="30" style="fill:#aaa" id="circle"/>
-  </svg:svg>
-  <textarea id="text" rows="4" cols="55"/>
-</body>
-</html>
-
-

Notes

-

The local name of a node is that part of the node's qualified name that comes after the colon. Qualified names are typically used in XML as part of the namespace(s) of the particular XML documents. For example, in the qualified name ecomm:partners, partners is the local name and ecomm is the prefix:

-
<ecomm:business id="soda_shop" type="brick_n_mortar" xmlns:ecomm="http://example.com/ecomm">
-  <ecomm:partners>
-    <ecomm:partner id="1001">Tony's Syrup Warehouse
-    </ecomm:partner>
-  </ecomm:partner>
-</ecomm:business>
-
- -
-

Note: In {{Gecko("1.9.2")}} and earlier, the property returns the upper-cased version of the local name for HTML elements in HTML DOMs (as opposed to XHTML elements in XML DOMs). In later versions, in compliance with HTML5, the property returns in the case of the internal DOM storage, which is lower case for both HTML elements in HTML DOMs and XHTML elements in XML DOMs. The {{domxref("element.tagName","tagName")}} property continues to return in the upper case for HTML elements in HTML DOMs.

-
-

For nodes of any type other than ELEMENT_NODE and ATTRIBUTE_NODE localName is always null.

-

Specification

- -

See also

- diff --git a/files/zh-cn/web/api/node/namespaceuri/index.html b/files/zh-cn/web/api/node/namespaceuri/index.html deleted file mode 100644 index 2aab7351fe..0000000000 --- a/files/zh-cn/web/api/node/namespaceuri/index.html +++ /dev/null @@ -1,138 +0,0 @@ ---- -title: Node.namespaceURI -slug: Web/API/Node/namespaceURI -translation_of: Web/API/Node/namespaceURI ---- -
{{APIRef("DOM")}}{{obsolete_header}}
- -

Node.namespaceURI 是一个只读属性,返回节点的命名空间URI(namespace URI),如果节点不在一个命名空间中,则返回 null。当节点是文档节点时,返回当前文档的 XML 命名空间(namespace)。

- -
-

在 DOM4 中, 此接口从Node 被移入 {{domxref("Element")}} 和 {{domxref("Attr")}}接口.

-
- -

语法

- -
namespace = node.namespaceURI
- -

示例

- -

在这个示例中, 使用 localName 和 namespaceURI来检查这个node. 如果 namespaceURI 返回 XUL 命名空间并且 localName 返回 "browser", 说明这个节点属于 XUL <browser/>.

- -
if (node.localName == "browser" &&
-    node.namespaceURI == "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul") {
-  // this is a XUL browser
-}
- -

备注

- -

这不是一个计算值,它是基于检查范围内的命名空间声明的名称空间查找的结果。节点的命名空间URI在节点创建时被固定。

- -

在Firefox 3.5或更早的版本中,HTML文档中HTML元素的名称空间URI是null。在之后的版本中,由http://www.w3.org/1999/xhtml 作为XHTML,符合HTML5. {{gecko_minversion_inline("1.9.2")}}

- -

除了ELEMENT_NODE a和 ATTRIBUTE_NODE 以外的 nodeType 中 node 的 namespaceURI 永远是null.

- -

你可以使用DOM2的方法 document.createElementNS 来创建一个有特殊 namespaceURI 的元素.

- -

XML的命名空间中,属性不会从它附加到的元素继承它的命名空间。如果属性未显式地给出命名空间,则它没有命名空间.

- -

DOM本身不处理或执行命名空间验证, 因此应该有由DOM应用程序进行必要的验证。请注意,命名空间前缀一旦与特定节点关联,则不能更改.

- -

规范

- - - - - - - - - - - - - - - - - - - - - - - - - - -
规范状态备注
{{SpecName("DOM3 Core", "core.html#ID-NodeNSname", "Node.namespaceURI")}}{{Spec2("DOM3 Core")}}当设置为 null 是指定动作.
{{SpecName("DOM2 Core", "core.html#Namespaces-Considerations", "DOM Level 2 Core: XML Namespaces")}}{{Spec2("DOM2 Core")}} 
{{SpecName("DOM2 Core", "core.html#ID-NodeNSname", "Node.namespaceURI")}}{{Spec2("DOM2 Core")}}初始化
- -

浏览器兼容性

- -
{{CompatibilityTable}}
- -
- - - - - - - - - - - - - - - - - - - - - -
特征ChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari
是否支持{{CompatVersionUnknown}}
- {{CompatNo}}46.0[1]
{{CompatVersionUnknown}}{{CompatVersionUnknown}}[2]
- {{CompatNo}} {{CompatGeckoDesktop("48.0")}}[1]
{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
-
- -
- - - - - - - - - - - - - - - - - - - - - -
特征AndroidEdgeFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
是否支持{{CompatUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}[2]
- {{CompatNo}} {{CompatGeckoMobile("48.0")}}[1]
{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
-
- -

[1] 从DOM4标准开始, 此接口被移入{{domxref("Element")}} 和 {{domxref("Attr")}} 接口.

- -

[2] 在 Gecko 5.0 之前 {{geckoRelease("5.0")}}, 这是一个读写属性; 从 Gecko 5.0 起,这是一个只读属性, 符合标准.

- -

参考

- - diff --git a/files/zh-cn/web/api/node/prefix/index.html b/files/zh-cn/web/api/node/prefix/index.html deleted file mode 100644 index 6883a89050..0000000000 --- a/files/zh-cn/web/api/node/prefix/index.html +++ /dev/null @@ -1,76 +0,0 @@ ---- -title: Node.prefix -slug: Web/API/Node/prefix -translation_of: Web/API/Node/prefix ---- -
- {{ApiRef}}
-

概述

-

prefix属性会返回当前节点的命名空间前缀,如果没有指定命名空间前缀,则返回null,该属性只读.

-

语法

-
string = element.prefix
-
-

示例

-

下面的代码将弹出"x".

-
<x:div onclick="alert(this.prefix)"/>
-
-

附注

-

该属性只在一个解析命名空间前缀的文档中可用,也就是说,只有在文档的MIME类型为XML,XHTML,XUL时可用,在HTML文档中不可用.

-

规范

- -

浏览器兼容性

-
- {{CompatibilityTable}}
-
- - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatUnknown}} -

{{CompatVersionUnknown}}

-

在Gecko 5.0 (Firefox 5.0 / Thunderbird 5.0 / SeaMonkey 2.2)之前,该属性是可写的; 之后,是只读的.

-
{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
-
-
- - - - - - - - - - - - - - - - - - - -
FeatureAndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatUnknown}} -

{{CompatVersionUnknown}}

-

P在Gecko 5.0 (Firefox 5.0 / Thunderbird 5.0 / SeaMonkey 2.2)之前,该属性是可写的; 之后,是只读的.

-
{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
-
-

-- cgit v1.2.3-54-g00ecf