哪里报错了 简单的AJAX
$.ajax({
type: "post",
url: "index.ashx/getinfo",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data) {
alert("成功了");
},
error: function (err) {
alert("报错了");
}
});
后台:
[WebMethod]
public static string getinfo()
{
return "Hi,Welcome to China!";
}