Document:afterscriptexecute 事件
非标准: 该特性是非标准的,请尽量不要在生产环境中使用它!
afterscriptexecute
事件会在静态 <script>
元素完成脚本执行时触发。如果元素是动态添加的(例如使用 appendChild()
),则不会触发此事件。
语法
在类似 addEventListener()
这样的方法中使用事件名称,或设置事件处理器属性。
js
addEventListener("afterscriptexecute", (event) => {});
onafterscriptexecute = (event) => {};
事件类型
通用的 Event
。
示例
js
function finished(e) {
logMessage(`ID 值为 ${e.target.id} 的脚本已完成`);
}
document.addEventListener("afterscriptexecute", finished, true);
// 或
document.onafterscriptexecute = finished;
规范
不属于任何规范。
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
afterscriptexecute event |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
- Non-standard. Check cross-browser support before using.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.