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

var client = new XMLHttpRequest()
  client.open("GET", "http://www.example.org/example.txt")
  client.ontimeout = (e) => {
    console.error("Timeout!!")
  }
  client.send()

addEventListener() equivalent

You could also set up the event handler using the addEventListener() method:

client.addEventListener('timeout', (e) => {
  console.error("Timeout!!");
})

Specifications

Specification Status Comment
XMLHttpRequest
The definition of 'timeout event' in that specification.
Living Standard  

Browser compatibility

No compatibility data found. Please contribute data for "api.XMLHttpRequest.timeout_event" (depth: 1) to the MDN compatibility data repository.

See also

Document Tags and Contributors

Last updated by: chrisdavidmills,