-3
返回类型可能在此URL的此分布式样式中?asp.net mvc不从cms应用程序中的url返回文本
$(function() {
$("#Submit1").click(function() {
$.ajax({
url: 'http://localhost:1890/Cache/Index/1',
type: 'POST',
dataType: 'text',
success: function (data) {
alert(data);
}
});
});
});
public string Index(int id)
{
return "true";
}
你得到一个错误?如果您将错误处理程序添加到您的ajax调用中,那么您可能会获得更多信息。 – Paddy 2012-01-17 13:58:25
没有错误仍然触发成功,这是空的警报 – maztt 2012-01-17 14:06:09
你试过只是省略dataType并让jQuery推断它吗? – Paddy 2012-01-17 14:08:28