From 156b518735b8da6cc954105b0a1250ca31449381 Mon Sep 17 00:00:00 2001 From: MDN Date: Sat, 22 May 2021 00:42:07 +0000 Subject: [CRON] sync translated content --- files/zh-cn/_redirects.txt | 3 +- files/zh-cn/_wikihistory.json | 32 ++++---- .../orphaned/web/api/childnode/remove/index.html | 96 ++++++++++++++++++++++ files/zh-cn/web/api/childnode/remove/index.html | 95 --------------------- 4 files changed, 114 insertions(+), 112 deletions(-) create mode 100644 files/zh-cn/orphaned/web/api/childnode/remove/index.html delete mode 100644 files/zh-cn/web/api/childnode/remove/index.html (limited to 'files/zh-cn') diff --git a/files/zh-cn/_redirects.txt b/files/zh-cn/_redirects.txt index eed8cfb8af..b928226809 100644 --- a/files/zh-cn/_redirects.txt +++ b/files/zh-cn/_redirects.txt @@ -1466,7 +1466,8 @@ /zh-CN/docs/Web/API/Canvas_API/Drawing_graphics_with_canvas /zh-CN/docs/conflicting/Web/API/Canvas_API/Tutorial /zh-CN/docs/Web/API/Channel_Messaging_API/使用_channel_messaging /zh-CN/docs/Web/API/Channel_Messaging_API/Using_channel_messaging /zh-CN/docs/Web/API/ChildNode.nextElementSibling /zh-CN/docs/Web/API/Element/nextElementSibling -/zh-CN/docs/Web/API/ChildNode.remove /zh-CN/docs/Web/API/ChildNode/remove +/zh-CN/docs/Web/API/ChildNode.remove /zh-CN/docs/orphaned/Web/API/ChildNode/remove +/zh-CN/docs/Web/API/ChildNode/remove /zh-CN/docs/orphaned/Web/API/ChildNode/remove /zh-CN/docs/Web/API/Childnode.previousElementSibling /zh-CN/docs/Web/API/Element/previousElementSibling /zh-CN/docs/Web/API/Coordinates /zh-CN/docs/Web/API/GeolocationCoordinates /zh-CN/docs/Web/API/Coordinates/latitude /zh-CN/docs/Web/API/GeolocationCoordinates/latitude diff --git a/files/zh-cn/_wikihistory.json b/files/zh-cn/_wikihistory.json index c3c80898d8..62e56751c9 100644 --- a/files/zh-cn/_wikihistory.json +++ b/files/zh-cn/_wikihistory.json @@ -9761,22 +9761,6 @@ "caoweiju" ] }, - "Web/API/ChildNode/remove": { - "modified": "2020-10-15T21:27:27.352Z", - "contributors": [ - "RainSlide", - "iSmartSV", - "duola8789", - "pasturn", - "Ende93", - "xgqfrms-GitHub", - "ceverytime", - "teoli", - "khalid32", - "ziyunfei", - "Darrel.Hsu" - ] - }, "Web/API/ChildNode/replaceWith": { "modified": "2020-10-15T21:56:06.625Z", "contributors": [ @@ -50277,6 +50261,22 @@ "smilewalker" ] }, + "orphaned/Web/API/ChildNode/remove": { + "modified": "2020-10-15T21:27:27.352Z", + "contributors": [ + "RainSlide", + "iSmartSV", + "duola8789", + "pasturn", + "Ende93", + "xgqfrms-GitHub", + "ceverytime", + "teoli", + "khalid32", + "ziyunfei", + "Darrel.Hsu" + ] + }, "orphaned/Web/API/Detecting_device_orientation": { "modified": "2020-10-15T21:21:28.912Z", "contributors": [ diff --git a/files/zh-cn/orphaned/web/api/childnode/remove/index.html b/files/zh-cn/orphaned/web/api/childnode/remove/index.html new file mode 100644 index 0000000000..b60cab7a0c --- /dev/null +++ b/files/zh-cn/orphaned/web/api/childnode/remove/index.html @@ -0,0 +1,96 @@ +--- +title: ChildNode.remove() +slug: orphaned/Web/API/ChildNode/remove +tags: + - API + - ChildNode + - DOM + - Method +translation_of: Web/API/ChildNode/remove +original_slug: Web/API/ChildNode/remove +--- +

{{APIRef("DOM")}}

+ +

ChildNode.remove() 方法,把对象从它所属的 DOM 树中删除。

+ +

语法

+ +
node.remove();
+ +

示例

+ +

使用 remove()

+ +
<div id="div-01">Here is div-01</div>
+<div id="div-02">Here is div-02</div>
+<div id="div-03">Here is div-03</div>
+
+ +
var el = document.getElementById('div-02');
+el.remove();
+// id 为 'div-02' 的 div 被删掉了
+
+ +

{{EmbedLiveSample('使用_remove()')}}

+ +

ChildNode.remove() 是不可见的

+ +

with 语句中,remove() 方法是不可见的。参阅 {{jsxref("Symbol.unscopables")}} 了解更多信息。

+ +
with(node) {
+  remove();
+}
+// ReferenceError: remove is not defined
+ +

Polyfill

+ +

You can polyfill the remove() method in Internet Explorer 9 and higher with the following code:

+ +
//https://github.com/jserz/js_piece/blob/master/DOM/ChildNode/remove()/remove().md
+(function (arr) {
+   arr.forEach(function (item) {
+    if (item.hasOwnProperty('remove')) {
+      return;
+    }
+    Object.defineProperty(item, 'remove', {
+      configurable: true,
+      enumerable: true,
+      writable: true,
+      value: function remove() {
+        this.parentNode.removeChild(this);
+      }
+    });
+  });
+})([Element.prototype, CharacterData.prototype, DocumentType.prototype]);
+ +

规范

+ + + + + + + + + + + + + + +
规范状态注释
{{SpecName('DOM WHATWG', '#dom-childnode-remove', 'ChildNode.remove')}}{{Spec2('DOM WHATWG')}}Initial definition.
+ +

浏览器兼容性

+ + + +

{{Compat("api.ChildNode.remove")}}

+ +

参见

+ + diff --git a/files/zh-cn/web/api/childnode/remove/index.html b/files/zh-cn/web/api/childnode/remove/index.html deleted file mode 100644 index 001975cd60..0000000000 --- a/files/zh-cn/web/api/childnode/remove/index.html +++ /dev/null @@ -1,95 +0,0 @@ ---- -title: ChildNode.remove() -slug: Web/API/ChildNode/remove -tags: - - API - - ChildNode - - DOM - - Method -translation_of: Web/API/ChildNode/remove ---- -

{{APIRef("DOM")}}

- -

ChildNode.remove() 方法,把对象从它所属的 DOM 树中删除。

- -

语法

- -
node.remove();
- -

示例

- -

使用 remove()

- -
<div id="div-01">Here is div-01</div>
-<div id="div-02">Here is div-02</div>
-<div id="div-03">Here is div-03</div>
-
- -
var el = document.getElementById('div-02');
-el.remove();
-// id 为 'div-02' 的 div 被删掉了
-
- -

{{EmbedLiveSample('使用_remove()')}}

- -

ChildNode.remove() 是不可见的

- -

with 语句中,remove() 方法是不可见的。参阅 {{jsxref("Symbol.unscopables")}} 了解更多信息。

- -
with(node) {
-  remove();
-}
-// ReferenceError: remove is not defined
- -

Polyfill

- -

You can polyfill the remove() method in Internet Explorer 9 and higher with the following code:

- -
//https://github.com/jserz/js_piece/blob/master/DOM/ChildNode/remove()/remove().md
-(function (arr) {
-   arr.forEach(function (item) {
-    if (item.hasOwnProperty('remove')) {
-      return;
-    }
-    Object.defineProperty(item, 'remove', {
-      configurable: true,
-      enumerable: true,
-      writable: true,
-      value: function remove() {
-        this.parentNode.removeChild(this);
-      }
-    });
-  });
-})([Element.prototype, CharacterData.prototype, DocumentType.prototype]);
- -

规范

- - - - - - - - - - - - - - -
规范状态注释
{{SpecName('DOM WHATWG', '#dom-childnode-remove', 'ChildNode.remove')}}{{Spec2('DOM WHATWG')}}Initial definition.
- -

浏览器兼容性

- - - -

{{Compat("api.ChildNode.remove")}}

- -

参见

- - -- cgit v1.2.3-54-g00ecf