var req = $.ajax({
type: 'GET',
cache: false,
url: 'loc.aspx?count=' + str,
dataType: 'json',
contentType: "application/json; charset=utf-8",
async: false,
data:'{}',
success: function (data) {
alert(data.responseText);
}
});
req.fail(function (data) {
TINY.box.show({ html: 'Server Error. Try again: ' + data.responseText, animate: false, close: false, boxid: 'error', top: 100 });
});
上面的代码曾经在 jsp 中正常工作,现在我正在尝试在 asp.net c# 中使用,无论如何我在错误块中获取正确的数据,我希望它在成功块中。甚至data.d
没有帮助,
如果我写的东西就像alert(data)
我得到了完整的 html,我只需要响应文本,当我这样使用data.responseText
时,我会变得不确定。请有人帮忙。
谢谢