From 6b573086c2fcb48632430e1a4730ca8cc32c65a4 Mon Sep 17 00:00:00 2001 From: MDN Date: Wed, 7 Apr 2021 00:11:12 +0000 Subject: [CRON] sync translated content --- files/zh-cn/_redirects.txt | 1 + files/zh-cn/_wikihistory.json | 16 +++--- .../web/guide/events/mutation_events/index.html | 63 ++++++++++++++++++++++ .../web/guide/events/mutation_events/index.html | 62 --------------------- 4 files changed, 72 insertions(+), 70 deletions(-) create mode 100644 files/zh-cn/orphaned/web/guide/events/mutation_events/index.html delete mode 100644 files/zh-cn/web/guide/events/mutation_events/index.html (limited to 'files/zh-cn') diff --git a/files/zh-cn/_redirects.txt b/files/zh-cn/_redirects.txt index 31e6895182..c22f490a05 100644 --- a/files/zh-cn/_redirects.txt +++ b/files/zh-cn/_redirects.txt @@ -2261,6 +2261,7 @@ /zh-CN/docs/Web/Guide/DOM /zh-CN/docs/conflicting/Web/API/Document_Object_Model_dd00a71ceceac547ab464128db6bd8ef /zh-CN/docs/Web/Guide/DOM/Whitespace_in_the_DOM /zh-CN/docs/Web/API/Document_Object_Model/Whitespace /zh-CN/docs/Web/Guide/Events/Media_events /zh-CN/docs/orphaned/Web/Guide/Events/Media_events +/zh-CN/docs/Web/Guide/Events/Mutation_events /zh-CN/docs/orphaned/Web/Guide/Events/Mutation_events /zh-CN/docs/Web/Guide/Events/Touch_events /zh-CN/docs/Web/API/Touch_events /zh-CN/docs/Web/Guide/Events/事件回调 /zh-CN/docs/Web/Guide/Events/Event_handlers /zh-CN/docs/Web/Guide/HTML /zh-CN/docs/Learn/HTML diff --git a/files/zh-cn/_wikihistory.json b/files/zh-cn/_wikihistory.json index ff8e2077c3..9f0050198c 100644 --- a/files/zh-cn/_wikihistory.json +++ b/files/zh-cn/_wikihistory.json @@ -28865,14 +28865,6 @@ "Darrel.Hsu" ] }, - "Web/Guide/Events/Mutation_events": { - "modified": "2019-03-23T22:51:23.609Z", - "contributors": [ - "Pada", - "peonyriver", - "FredWe" - ] - }, "Web/Guide/Events/Orientation_and_motion_data_explained": { "modified": "2019-03-23T23:10:07.666Z", "contributors": [ @@ -50798,5 +50790,13 @@ "ziyunfei", "Anonymous" ] + }, + "orphaned/Web/Guide/Events/Mutation_events": { + "modified": "2019-03-23T22:51:23.609Z", + "contributors": [ + "Pada", + "peonyriver", + "FredWe" + ] } } \ No newline at end of file diff --git a/files/zh-cn/orphaned/web/guide/events/mutation_events/index.html b/files/zh-cn/orphaned/web/guide/events/mutation_events/index.html new file mode 100644 index 0000000000..732cb7614b --- /dev/null +++ b/files/zh-cn/orphaned/web/guide/events/mutation_events/index.html @@ -0,0 +1,63 @@ +--- +title: Mutation events +slug: orphaned/Web/Guide/Events/Mutation_events +translation_of: Web/Guide/Events/Mutation_events +original_slug: Web/Guide/Events/Mutation_events +--- +

{{deprecated_header()}}

+ +

Mutation 事件 为web页面提供一种机制或扩展,以便在DOM被改变时获得通知。如果可能请用Mutation Observers代替。

+ +

前言

+ +

这个 mutation 事件在DOM Events 标准 中已被列为反对使用 , 因为在API的设计中有缺陷 (详情见发表于 public-webapps 的"DOM Mutation Events Replacement: The Story So Far / Existing Points of Consensus" )

+ +

Mutation Observers 在DOM4中被提议用来取代mutation事件. 预计它们被列入 in Firefox 14 and Chrome 18中。

+ +

避免用mutation事件的实际原因是性能问题跨浏览器支持

+ +

性能

+ +

为DOM添加 mutation 监听器极度降低进一步修改DOM文档的性能(慢1.5 - 7倍),此外, 移除监听器不会逆转的损害。

+ +

性能好坏 限制了文档拥有mutation事件监听.

+ +

跨浏览器支持

+ +

这些事件在不同的浏览器实现并不一致, 例如:

+ + + +

Dottoro documents browser support for mutation events.

+ +

Mutation 事件列表

+ +

下面是所有 mutation 事件列表, DOM Level 3 Events specification 中定义的:

+ + + +

使用

+ +

你可以如下所示使用element.addEventListener 注册一个mutation 事件监听器:

+ +
element.addEventListener("DOMNodeInserted", function (ev) {
+  // ...
+}, false);
+
+ +

事件对象在 {{ domxref("MutationEvent") }}传递给监听器 (见 its definition in the specification) 对于大多数的事件, 和 {{ domxref("MutationNameEvent") }} 用于 DOMAttributeNameChanged and DOMElementNameChanged.

diff --git a/files/zh-cn/web/guide/events/mutation_events/index.html b/files/zh-cn/web/guide/events/mutation_events/index.html deleted file mode 100644 index ea2be04985..0000000000 --- a/files/zh-cn/web/guide/events/mutation_events/index.html +++ /dev/null @@ -1,62 +0,0 @@ ---- -title: Mutation events -slug: Web/Guide/Events/Mutation_events -translation_of: Web/Guide/Events/Mutation_events ---- -

{{deprecated_header()}}

- -

Mutation 事件 为web页面提供一种机制或扩展,以便在DOM被改变时获得通知。如果可能请用Mutation Observers代替。

- -

前言

- -

这个 mutation 事件在DOM Events 标准 中已被列为反对使用 , 因为在API的设计中有缺陷 (详情见发表于 public-webapps 的"DOM Mutation Events Replacement: The Story So Far / Existing Points of Consensus" )

- -

Mutation Observers 在DOM4中被提议用来取代mutation事件. 预计它们被列入 in Firefox 14 and Chrome 18中。

- -

避免用mutation事件的实际原因是性能问题跨浏览器支持

- -

性能

- -

为DOM添加 mutation 监听器极度降低进一步修改DOM文档的性能(慢1.5 - 7倍),此外, 移除监听器不会逆转的损害。

- -

性能好坏 限制了文档拥有mutation事件监听.

- -

跨浏览器支持

- -

这些事件在不同的浏览器实现并不一致, 例如:

- - - -

Dottoro documents browser support for mutation events.

- -

Mutation 事件列表

- -

下面是所有 mutation 事件列表, DOM Level 3 Events specification 中定义的:

- - - -

使用

- -

你可以如下所示使用element.addEventListener 注册一个mutation 事件监听器:

- -
element.addEventListener("DOMNodeInserted", function (ev) {
-  // ...
-}, false);
-
- -

事件对象在 {{ domxref("MutationEvent") }}传递给监听器 (见 its definition in the specification) 对于大多数的事件, 和 {{ domxref("MutationNameEvent") }} 用于 DOMAttributeNameChanged and DOMElementNameChanged.

-- cgit v1.2.3-54-g00ecf