找回密码
 立即注册

QQ登录

只需一步,快速开始

sgs

中级会员

74

主题

219

帖子

637

积分

中级会员

积分
637

活字格认证微信认证勋章

sgs
中级会员   /  发表于:2018-4-10 09:55  /   查看:3344  /  回复:2
  1.     wijmo.httpRequest(url, {
  2.         data: params,
  3.         method: 'POST',
  4.         beforeSend:()=>{

  5.         },
  6.         success: (xhr)=>{
  7.             callback(xhr);
  8.         },
  9.         error: (xhr)=>{
  10.             //<font color="#ff0000">此处未能获取,是否存在bug?</font>
  11.             alert('失败');
  12.         },
  13.         complete:(xhr)=>{

  14.         }
  15.     });
复制代码
请教下如上代码,为何我无法截获error事件呢

2 个回复

倒序浏览
DLink
注册会员   /  发表于:2018-4-10 17:39:58
沙发
这个你可以下这个文档看是不是有error的定义。
回复 使用道具 举报
JeffryLI
葡萄城公司职员   /  发表于:2018-4-10 17:49:22
板凳
您好,error是支持的,具体看您怎请求的
  1. wijmo.httpRequest('http://services.odata.org/Northwind/Northwind.svc/Customers?$format=json', {
  2.   success: function (xhr) {
  3.     var response = JSON.parse(xhr.response),
  4.         customers = response.value;

  5.     // do something with the customers...
  6.   }
  7. });
复制代码
请点击评分,对我5分评价,谢谢!

葡萄城控件服务团队
官方网站: https://www.grapecity.com.cn/developer
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部