XMLHttpRequestEventTarget

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 对象作为参数。

规范

规范 状态 备注
XMLHttpRequest Living Standard WHATWG living standard

浏览器兼容性

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
XMLHttpRequestEventTargetChrome Full support 1Edge Full support 12Firefox Full support 1IE Full support 7Opera Full support YesSafari Full support 1WebView Android Full support 1Chrome Android Full support 18Firefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support 1.0
onabortChrome Full support YesEdge Full support ≤18Firefox Full support YesIE Full support 10Opera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
onerrorChrome Full support YesEdge Full support ≤18Firefox Full support YesIE Full support 10Opera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
onloadChrome Full support YesEdge Full support ≤18Firefox Full support YesIE Full support 9Opera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
onloadendChrome Full support YesEdge Full support ≤18Firefox Full support YesIE Full support 10Opera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
onloadstartChrome Full support YesEdge Full support ≤18Firefox Full support YesIE Full support 10Opera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
onprogressChrome Full support YesEdge Full support ≤18Firefox Full support YesIE Full support 10Opera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
ontimeoutChrome Full support YesEdge Full support ≤18Firefox Full support YesIE Full support 8Opera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes

Legend

Full support  
Full support

参见