From 6acf87987baea4675dbd1d5586663959e742cc03 Mon Sep 17 00:00:00 2001 From: MDN Date: Tue, 22 Feb 2022 00:12:14 +0000 Subject: [CRON] sync translated content --- .../document/afterscriptexecute_event/index.html | 45 ++++++++++++++++++++++ .../document/beforescriptexecute_event/index.html | 45 ++++++++++++++++++++++ .../api/document/onafterscriptexecute/index.html | 45 ---------------------- .../api/document/onbeforescriptexecute/index.html | 44 --------------------- 4 files changed, 90 insertions(+), 89 deletions(-) create mode 100644 files/zh-cn/web/api/document/afterscriptexecute_event/index.html create mode 100644 files/zh-cn/web/api/document/beforescriptexecute_event/index.html delete mode 100644 files/zh-cn/web/api/document/onafterscriptexecute/index.html delete mode 100644 files/zh-cn/web/api/document/onbeforescriptexecute/index.html (limited to 'files/zh-cn/web/api/document') diff --git a/files/zh-cn/web/api/document/afterscriptexecute_event/index.html b/files/zh-cn/web/api/document/afterscriptexecute_event/index.html new file mode 100644 index 0000000000..ea939df105 --- /dev/null +++ b/files/zh-cn/web/api/document/afterscriptexecute_event/index.html @@ -0,0 +1,45 @@ +--- +title: element.onafterscriptexecute +slug: Web/API/Document/afterscriptexecute_event +tags: + - DOM + - onafterscriptexecute +translation_of: Web/API/Document/onafterscriptexecute +original_slug: Web/API/Document/onafterscriptexecute +--- +
{{ApiRef}}{{gecko_minversion_header("2")}}
+ +

概述

+ +

当HTML文档中的{{HTMLElement("script")}}标签内的代码执行完毕时触发该事件,如果这个script标签是用appendChild()等方法动态添加上去的,则不会触发该事件.

+ +

语法

+ +
document.onafterscriptexecute = funcRef;
+
+ +

afterscriptexecute事件触发时,funcRef函数就会被调用. 传入参数eventtarget属性指向触发该事件的那个script元素.

+ +

例子

+ +
function finished(e) {
+  logMessage("Finished script with ID: " + e.target.id);
+}
+
+document.addEventListener("afterscriptexecute", finished, true);
+
+ +

查看在线演示

+ +

规范

+ + + +

相关链接

+ + diff --git a/files/zh-cn/web/api/document/beforescriptexecute_event/index.html b/files/zh-cn/web/api/document/beforescriptexecute_event/index.html new file mode 100644 index 0000000000..1835407a01 --- /dev/null +++ b/files/zh-cn/web/api/document/beforescriptexecute_event/index.html @@ -0,0 +1,45 @@ +--- +title: element.onbeforescriptexecute +slug: Web/API/Document/beforescriptexecute_event +tags: + - DOM + - onbeforescriptexecute +translation_of: Web/API/Document/onbeforescriptexecute +original_slug: Web/API/Document/onbeforescriptexecute +--- +
{{ApiRef}}{{gecko_minversion_header("2")}}
+ +

概述

+ +

当HTML文档中的<script>标签内的代码将要执行时触发该事件,如果这个script标签是用appendChild()等方法动态添加上去的,则不会触发该事件.

+ +

语法

+ +
document.onbeforescriptexecute = funcRef;
+
+ +

beforescriptexecute事件触发时,funcRef函数就会被调用. 传入参数eventtarget属性指向触发该事件的那个script元素.

+ +

例子

+ +
function starting(e) {
+  logMessage("Starting script with ID: " + e.target.id);
+}
+
+document.addEventListener("beforescriptexecute", starting, true);
+
+ +

查看在线演示

+ +

规范

+ + + +

相关链接

+ + diff --git a/files/zh-cn/web/api/document/onafterscriptexecute/index.html b/files/zh-cn/web/api/document/onafterscriptexecute/index.html deleted file mode 100644 index 5e4454cc86..0000000000 --- a/files/zh-cn/web/api/document/onafterscriptexecute/index.html +++ /dev/null @@ -1,45 +0,0 @@ ---- -title: element.onafterscriptexecute -slug: Web/API/Document/onafterscriptexecute -tags: - - DOM - - onafterscriptexecute -translation_of: Web/API/Document/onafterscriptexecute -original_slug: Web/API/Element/onafterscriptexecute ---- -
{{ApiRef}}{{gecko_minversion_header("2")}}
- -

概述

- -

当HTML文档中的{{HTMLElement("script")}}标签内的代码执行完毕时触发该事件,如果这个script标签是用appendChild()等方法动态添加上去的,则不会触发该事件.

- -

语法

- -
document.onafterscriptexecute = funcRef;
-
- -

afterscriptexecute事件触发时,funcRef函数就会被调用. 传入参数eventtarget属性指向触发该事件的那个script元素.

- -

例子

- -
function finished(e) {
-  logMessage("Finished script with ID: " + e.target.id);
-}
-
-document.addEventListener("afterscriptexecute", finished, true);
-
- -

查看在线演示

- -

规范

- - - -

相关链接

- - diff --git a/files/zh-cn/web/api/document/onbeforescriptexecute/index.html b/files/zh-cn/web/api/document/onbeforescriptexecute/index.html deleted file mode 100644 index 3025444d28..0000000000 --- a/files/zh-cn/web/api/document/onbeforescriptexecute/index.html +++ /dev/null @@ -1,44 +0,0 @@ ---- -title: element.onbeforescriptexecute -slug: Web/API/Document/onbeforescriptexecute -tags: - - DOM - - onbeforescriptexecute -translation_of: Web/API/Document/onbeforescriptexecute ---- -
{{ApiRef}}{{gecko_minversion_header("2")}}
- -

概述

- -

当HTML文档中的<script>标签内的代码将要执行时触发该事件,如果这个script标签是用appendChild()等方法动态添加上去的,则不会触发该事件.

- -

语法

- -
document.onbeforescriptexecute = funcRef;
-
- -

beforescriptexecute事件触发时,funcRef函数就会被调用. 传入参数eventtarget属性指向触发该事件的那个script元素.

- -

例子

- -
function starting(e) {
-  logMessage("Starting script with ID: " + e.target.id);
-}
-
-document.addEventListener("beforescriptexecute", starting, true);
-
- -

查看在线演示

- -

规范

- - - -

相关链接

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