Jquery-Resonse.statusText未定义,即使它显示在浏览器工具中
在我的操作方法中,我返回:Jquery-Resonse.statusText未定义,即使它显示在浏览器工具中,jquery,asp.net-mvc,backbone.js,Jquery,Asp.net Mvc,Backbone.js,在我的操作方法中,我返回: catch (Exception ex) { return new HttpStatusCodeResult(500, "This is an error!"); } 在我的backbone.js fetch中,我使用的是: error: function(response, status, error) { alert(response.statusText); } broswer工具在状态下显示我的消息,但alert
catch (Exception ex)
{
return new HttpStatusCodeResult(500, "This is an error!");
}
在我的backbone.js fetch中,我使用的是:
error: function(response, status, error) {
alert(response.statusText);
}
broswer工具在状态下显示我的消息,但alertbox显示未定义。
我在这个线程中看到了这个方法->
知道它为什么不起作用吗?以下是
错误
回调的参数:
(model, response, options)
因此,基本上您试图获取
model.statusText
,这当然是未定义的。response
与第二个参数相对应,因此请尝试response.statusText
(在您的示例中,status.statusText
~~)。谢谢,我知道这很简单。