过时
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 的生产站点中使用它:它不适用于每个用户。实现之间可能存在大的不兼容性,且行为将来可能改变。
An event handler which is called when an
XDomainRequest
encounters an error.
注意:
There is no way to determine the cause of the error from the
XDomainRequest
接口。
xdr.onerror = funcRef;
funcRef
A function to call when an error occurs.
var xdr = new XDomainRequest();
xdr.open("POST", "http://example.com/api/method");
xdr.onerror = function(){
//Handle Error
}
xdr.onload = function(){
//Handle Response with xdr.responseText
}
xdr.send("param1=value1¶m2=value2");
Not part of any specification.
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
onerror
弃用
非标
|
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