XMLHttpRequestEventTarget

XMLHttpRequestEventTarget is the interface that describes the event handlers you can implement in an object that will handle events for an XMLHttpRequest .

特性

XMLHttpRequestEventTarget.onabort
Contains the function to call when a request is aborted and the abort event is received by this object.
XMLHttpRequestEventTarget.onerror
Contains the function to call when a request encounters an error and the error event is received by this object.
XMLHttpRequestEventTarget.onload
Contains the function to call when an HTTP request returns after successfully fetching content and the load event is received by this object.
XMLHttpRequestEventTarget.onloadstart
Contains the function that gets called when the HTTP request first begins loading data and the loadstart event is received by this object.
XMLHttpRequestEventTarget.onprogress
Contains the function that is called periodically with information about the progress of the request and the progress event is received by this object.
XMLHttpRequestEventTarget.ontimeout
Contains the function that is called if the event times out and the timeout event is received by this object; this only happens if a timeout has been previously established by setting the value of the XMLHttpRequest object's timeout 属性。
XMLHttpRequestEventTarget.onloadend
Contains the function that is called when the load is completed, even if the request failed, and the loadend event is received by this object.

规范

规范 状态 Comment
XMLHttpRequest 实时标准 WHATWG living standard

浏览器兼容性

更新 GitHub 上的兼容性数据
Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
XMLHttpRequestEventTarget Chrome 1 Edge 12 Firefox 1 IE 7 Opera Yes Safari 1 WebView Android 1 Chrome Android 18 Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android 1.0
onabort 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
onerror 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
onload Chrome Yes Edge ≤18 Firefox Yes IE 9 Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
onloadend 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
onloadstart 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
onprogress 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
ontimeout Chrome Yes Edge ≤18 Firefox Yes IE 8 Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes

图例

完整支持
完整支持

另请参阅