ErrorEvent:filename 属性
备注: 此特性在 Web Worker 中可用。
ErrorEvent
接口的 filename
只读属性返回包含发生错误的脚本文件的名称的字符串。
值
字符串
示例
js
window.addEventListener("error", (ev) => {
console.log("文件 " + ev.filename + " 中出现错误");
});
规范
Specification |
---|
HTML # dom-errorevent-filename |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | server | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
filename |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
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.