The timeout event is fired when progression is terminated due to preset time expiring.
| Bubbles | No |
| Cancelable | No |
| Interface | ProgressEvent
|
| Event handler property | XMLHttpRequestEventTarget.ontimeout
|
Examples
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() method:
client.addEventListener('timeout', () => {
console.error("Timeout!!");
});
Specifications
| Specification | Status | Comment |
|---|---|---|
| XMLHttpRequestThe definition of 'timeout event' in that specification. | Living Standard |
Browser compatibility
Update compatibility data on GitHub
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
timeout event
|
Chrome
Full support Yes |
Edge
Full support ≤18 |
Firefox
Full support Yes |
IE
Full support 10 |
Opera
Full support Yes |
Safari
Full support Yes |
WebView Android
Full support Yes |
Chrome Android
Full support Yes |
Firefox Android
Full support Yes |
Opera Android
Full support Yes |
Safari iOS
Full support Yes |
Samsung Internet Android
Full support Yes |
Legend
- Full support
- Full support
See also
XMLHttpRequest: timeout event by Mozilla Contributors is licensed under CC-BY-SA 2.5.