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 --- .../api/baseaudiocontext/onstatechange/index.html | 102 --------------------- .../baseaudiocontext/statechange_event/index.html | 102 +++++++++++++++++++++ .../document/afterscriptexecute_event/index.html | 45 +++++++++ .../document/beforescriptexecute_event/index.html | 45 +++++++++ .../api/document/onafterscriptexecute/index.html | 45 --------- .../api/document/onbeforescriptexecute/index.html | 44 --------- 6 files changed, 192 insertions(+), 191 deletions(-) delete mode 100644 files/zh-cn/web/api/baseaudiocontext/onstatechange/index.html create mode 100644 files/zh-cn/web/api/baseaudiocontext/statechange_event/index.html 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') diff --git a/files/zh-cn/web/api/baseaudiocontext/onstatechange/index.html b/files/zh-cn/web/api/baseaudiocontext/onstatechange/index.html deleted file mode 100644 index b2ee0a7463..0000000000 --- a/files/zh-cn/web/api/baseaudiocontext/onstatechange/index.html +++ /dev/null @@ -1,102 +0,0 @@ ---- -title: AudioContext.onstatechange -slug: Web/API/BaseAudioContext/onstatechange -translation_of: Web/API/BaseAudioContext/onstatechange -original_slug: Web/API/AudioContext/onstatechange ---- -

{{ APIRef("Web Audio API") }}

- -
-

{{ domxref("AudioContext") }}的onstatechange属性定义了一个事件处理器函数,触发{{Event("statechange")}}会被调用,也就是说audio context的状态发生变化时会执行。

-
- -

语法

- -
var audioCtx = new AudioContext();
-audioCtx.onstatechange = function() { ... };
- -

例子

- -

下面这段代码是AudioContext states DEMO (直接运行)中的,其中onstatechange处理器会在每次当前{{domxref("state")}}发生变化时把它输出到控制台。

- -
audioCtx.onstatechange = function() {
-  console.log(audioCtx.state);
-}
-
- -

规范

- - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('Web Audio API', '#widl-AudioContext-onstatechange', 'onstatechange')}}{{Spec2('Web Audio API')}} 
- -

浏览器兼容性

- -
{{CompatibilityTable}}
- -
- - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support{{CompatChrome(43.0)}}{{CompatGeckoDesktop(40.0)}} {{CompatNo}}{{CompatUnknown}}{{CompatUnknown}}
-
- -
- - - - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidFirefox Mobile (Gecko)Firefox OSIE MobileOpera MobileSafari MobileChrome for Android
Basic support{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
-
- -

另见

- - diff --git a/files/zh-cn/web/api/baseaudiocontext/statechange_event/index.html b/files/zh-cn/web/api/baseaudiocontext/statechange_event/index.html new file mode 100644 index 0000000000..88adcced3b --- /dev/null +++ b/files/zh-cn/web/api/baseaudiocontext/statechange_event/index.html @@ -0,0 +1,102 @@ +--- +title: AudioContext.onstatechange +slug: Web/API/BaseAudioContext/statechange_event +translation_of: Web/API/BaseAudioContext/onstatechange +original_slug: Web/API/BaseAudioContext/onstatechange +--- +

{{ APIRef("Web Audio API") }}

+ +
+

{{ domxref("AudioContext") }}的onstatechange属性定义了一个事件处理器函数,触发{{Event("statechange")}}会被调用,也就是说audio context的状态发生变化时会执行。

+
+ +

语法

+ +
var audioCtx = new AudioContext();
+audioCtx.onstatechange = function() { ... };
+ +

例子

+ +

下面这段代码是AudioContext states DEMO (直接运行)中的,其中onstatechange处理器会在每次当前{{domxref("state")}}发生变化时把它输出到控制台。

+ +
audioCtx.onstatechange = function() {
+  console.log(audioCtx.state);
+}
+
+ +

规范

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('Web Audio API', '#widl-AudioContext-onstatechange', 'onstatechange')}}{{Spec2('Web Audio API')}} 
+ +

浏览器兼容性

+ +
{{CompatibilityTable}}
+ +
+ + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support{{CompatChrome(43.0)}}{{CompatGeckoDesktop(40.0)}} {{CompatNo}}{{CompatUnknown}}{{CompatUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidFirefox Mobile (Gecko)Firefox OSIE MobileOpera MobileSafari MobileChrome for Android
Basic support{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
+
+ +

另见

+ + 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