【发布时间】:2013-12-27 21:12:14
【问题描述】:
我在 asp.net mvc 4 中使用 ajax.beginform。在我的控制器中,我有一个 try catch 块
catch (Exception ex)
{
throw new HttpException(500, ex.Message);
}
在我的 onFailure 事件中
function failure(data) {
$(".progress").hide();
$.msgGrowl({
type: 'error',
title: 'error',
text: data.statusText
});
}
data.statusText 的结果是“内部服务器错误”。在 data.responseText 中,我看到页面的标题标签包含我想要获取的消息。根据本网站上的一些其他建议,我已更改为
var html = data.responseText;
var error = html.find("title");
但随后我收到一条错误消息,提示没有 find 方法。
非常感谢任何帮助。
【问题讨论】:
-
你可以试试
$(html).find("title")
标签: jquery ajax asp.net-mvc