CloseEvent()
构造函数创建新
CloseEvent
.
var event = new CloseEvent(typeArg, closeEventInit);
typeArg
DOMString
表示事件的名称。
closeEventInit
可选
CloseEventInit
字典,拥有以下字段:
"wasClean"
, optional and defaulting to
false
, of type
long
, indicates if the connection has been closed cleanly or not.
"code"
, optional and defaulting to
0
, of type
unsigned short
, that is the connection close code sent by the server.
"reason"
, optional and defaulting to
''
, of type
DOMString
, that is a human-readable reason why the server closed the connection.
CloseEventInit
字典还接受字段来自
EventInit
字典。
| 规范 | 状态 | 注释 |
|---|---|---|
|
HTML 实时标准
The definition of 'CloseEvent()' in that specification. |
实时标准 | 初始定义。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
CloseEvent()
构造函数
|
Chrome ? | Edge ? | Firefox 8 | IE ? | Opera ? | Safari ? | WebView Android ? | Chrome Android ? | Firefox Android 8 | Opera Android ? | Safari iOS ? | Samsung Internet Android ? |
完整支持
兼容性未知
CloseEvent
,构造对象的接口。
CloseEvent
CloseEvent()