XMLHttpRequestEventTarget.onloadstart

XMLHttpRequestEventTarget.onloadstart 在XMLHttpRequest 开始传送数据时被调用

语法

XMLHttpRequest.onloadstart = callback;

  • callback 是开始传送数据时被调用的回调函数

示例

var xmlhttp = new XMLHttpRequest(),
  method = 'GET',
  url = 'https://developer.mozilla.org/';

xmlhttp.open(method, url, true);
xmlhttp.onloadstart = function () {
  console.log("Download underway");
};
xmlhttp.send();

规范

规范 状态 说明
XMLHttpRequest Living Standard WHATWG 现存标准

浏览器兼容性

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
onloadstartChrome Full support YesEdge Full support YesFirefox Full support YesIE ? Opera 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
Compatibility unknown  
Compatibility unknown