XMLHttpRequestEventTarget
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
备注: 此特性在 Web Worker(不包括 Service Worker)中可用。
XMLHttpRequestEventTarget
是一个描述事件处理程序的接口,你可以在一个用于处理 XMLHttpRequest
事件的对象中使用到该事件处理程序。
属性
XMLHttpRequestEventTarget.onabort
-
当请求失败时调用该方法,接受
abort
对象作为参数。 XMLHttpRequestEventTarget.onerror
-
当请求发生错误时调用该方法,接受
error
对象作为参数。 XMLHttpRequestEventTarget.onload
-
当一个 HTTP 请求正确加载出内容后返回时调用,接受
load
对象作为参数。 XMLHttpRequestEventTarget.onloadstart
-
当一个 HTTP 请求开始加载数据时调用,接受
loadstart
对象作为参数。 XMLHttpRequestEventTarget.onprogress
-
间歇调用该方法用来获取请求过程中的信息,接受
progress
对象作为参数。 XMLHttpRequestEventTarget.ontimeout
-
当超时时调用,接受
timeout
对象作为参数;只有设置了XMLHttpRequest
对象的timeout
属性时,才可能发生超时事件。 XMLHttpRequestEventTarget.onloadend
-
当内容加载完成,不管失败与否,都会调用该方法,接受
loadend
对象作为参数。
规范
Specification |
---|
XMLHttpRequest # xmlhttprequesteventtarget |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
XMLHttpRequestEventTarget |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.