aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/document/onafterscriptexecute/index.html
diff options
context:
space:
mode:
authorFlorian Dieminger <me@fiji-flo.de>2021-02-11 18:29:51 +0100
committerGitHub <noreply@github.com>2021-02-11 18:29:51 +0100
commit2bc5610921312613f8623f7ed347aa576689b2b6 (patch)
treef17a7a00e232c97d1335ff3cb24dbcfafacfe141 /files/zh-cn/web/api/document/onafterscriptexecute/index.html
parent964decad361766e85d928a56f0ab80af0e75c172 (diff)
parentfc56124ac4eda6b3f0349c8a16fa750f27b4c7d6 (diff)
downloadtranslated-content-2bc5610921312613f8623f7ed347aa576689b2b6.tar.gz
translated-content-2bc5610921312613f8623f7ed347aa576689b2b6.tar.bz2
translated-content-2bc5610921312613f8623f7ed347aa576689b2b6.zip
Merge pull request #32 from fiji-flo/unslugging-zh-cn
Unslugging zh cn
Diffstat (limited to 'files/zh-cn/web/api/document/onafterscriptexecute/index.html')
-rw-r--r--files/zh-cn/web/api/document/onafterscriptexecute/index.html45
1 files changed, 45 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/document/onafterscriptexecute/index.html b/files/zh-cn/web/api/document/onafterscriptexecute/index.html
new file mode 100644
index 0000000000..74bd826004
--- /dev/null
+++ b/files/zh-cn/web/api/document/onafterscriptexecute/index.html
@@ -0,0 +1,45 @@
+---
+title: element.onafterscriptexecute
+slug: Web/API/Document/onafterscriptexecute
+tags:
+ - DOM
+ - onafterscriptexecute
+translation_of: Web/API/Document/onafterscriptexecute
+original_slug: Web/API/Element/onafterscriptexecute
+---
+<div>{{ApiRef}}{{gecko_minversion_header("2")}}</div>
+
+<h2 id="概述">概述</h2>
+
+<p>当HTML文档中的{{HTMLElement("script")}}标签内的代码执行完毕时触发该事件,如果这个<code>script</code>标签是用<code>appendChild()</code>等方法动态添加上去的,则不会触发该事件.</p>
+
+<h2 id="语法">语法</h2>
+
+<pre class="syntaxbox"><em>document.onafterscriptexecute = funcRef;</em>
+</pre>
+
+<p>当<code>afterscriptexecute</code>事件触发时,<code>funcRef</code>函数就会被调用. 传入参数<code>event</code>的<code>target</code>属性指向触发该事件的那个<code>script</code>元素.</p>
+
+<h2 id="例子">例子</h2>
+
+<pre class="brush:js">function finished(e) {
+ logMessage("Finished script with ID: " + e.target.id);
+}
+
+document.addEventListener("afterscriptexecute", finished, true);
+</pre>
+
+<p><a href="/samples/html/currentScript.html">查看在线演示</a></p>
+
+<h2 id="规范">规范</h2>
+
+<ul>
+ <li><a href="http://www.whatwg.org/specs/web-apps/current-work/#the-script-element" title="http://www.whatwg.org/specs/web-apps/current-work/#the-script-element">HTML5</a></li>
+</ul>
+
+<h2 id="相关链接">相关链接</h2>
+
+<ul>
+ <li>{{domxref("element.onbeforescriptexecute")}}</li>
+ <li>{{domxref("document.currentScript")}}</li>
+</ul>