timeout
event is fired when progression is terminated due to preset time expiring.
| 冒泡 | No |
|---|---|
| 可取消 | No |
| 接口 |
ProgressEvent
|
| 事件处理程序特性 |
XMLHttpRequestEventTarget.ontimeout
|
const client = new XMLHttpRequest();
client.open('GET', 'http://www.example.org/example.txt');
client.ontimeout = () => {
console.error('Timeout!!')
};
client.send();
You could also set up the event handler using the
addEventListener()
方法:
client.addEventListener('timeout', () => {
console.error("Timeout!!");
});
| 规范 | 状态 | 注释 |
|---|---|---|
|
XMLHttpRequest
The definition of 'timeout event' in that specification. |
实时标准 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
timeout
event
|
Chrome Yes | Edge ≤18 | Firefox Yes | IE 10 | Opera Yes | Safari Yes | WebView Android Yes | Chrome Android Yes | Firefox Android Yes | Opera Android Yes | Safari iOS Yes | Samsung Internet Android Yes |
完整支持