DOMException.code
DOMException
接口中的 code
是一个只读属性,他返回了一个包含了 错误常量 的简短
数字,或者在没有匹配到时返回 0
。这个字段产生于历史原因,在新的 DOM 异常中已停止使用,改为在 DOMException.name
属性中推送此信息。
语法
var domExceptionCode = domExceptionInstance.code;
值
一个数字
规范
Specification |
---|
Web IDL # dom-domexception-code |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | server | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
code |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- Deprecated. Not for use in new websites.
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.