过时
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.
非标
此特征是非标准的,且不在标准轨道中。不要在面向 Web 的生产站点中使用它:它不适用于每个用户。实现之间可能存在大的不兼容性,且行为将来可能改变。
This method is called periodically as an event handler for
progress
events on
XDomainRequest
s, so that code can monitor progress while loading content.
注意:
While handling this event, you can look at
XDomainRequest.responseText
to get the response so far.
Once loading is complete, the
XDomainRequest.onload
event handler gets called.
xdr.onprogress = funcRef;
funcRef
progress
events occur.
var xdr = new XDomainRequest();
xdr.open("POST", "http://example.com/api/method");
xdr.onprogress = function(){
//Handle Partial Response with xdr.responseText
}
xdr.onload = function(){
//Handle Response with xdr.responseText
}
xdr.send("param1=value1¶m2=value2");
Not part of any specification.
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
onprogress
弃用
非标
|
Chrome No | Edge No | Firefox No | IE 8 — 11 | Opera No | Safari No | WebView Android No | Chrome Android No | Firefox Android No | Opera Android No | Safari iOS No | Samsung Internet Android No |
不支持
非标。预期跨浏览器支持较差。
弃用。不要用于新网站。
XDomainRequest
onerror
onload
onprogress
ontimeout
responseText
timeout
onprogress