DOMException()
DOMException()
构造函数返回一个包含指定的信息和名称的 DOMException
对象。
语法
var domException = new DOMException(); var domException = new DOMException(message); var domException = new DOMException(message, name);
参数
message
可选- 对异常的描述.如果不存在, 使用空字符串
''
. name
可选- 返回一个
DOMString
包含与 error constant 错误相关的字符串常数之一. -
返回值
DOMException
- 一个新创建的
DOMException
对象.
例子
TBD
规范
Specification | Status | Comment |
---|---|---|
Web IDL constructor |
Candidate Recommendation | Adds the constructor for the DOMException class. |
浏览器兼容性
We're converting our compatibility data into a machine-readable JSON format.
This compatibility table still uses the old format,
because we haven't yet converted the data it contains.
Find out how you can help! (en-US)
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | 46.0 | ? | 未实现 | ? | ? |
Feature | Android | Android Webview | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile | Chrome for Android |
---|---|---|---|---|---|---|---|
Basic support | 未实现 | 46.0 | ? | ? | ? | ? | 46.0 |