$(function () {
$.ajax({
type: "POST",
url: "http://localhost/j.json",
data: {
"employees": [{
"firstName": "Peter",
"lastName": "Jones"
}]
},
success: function () {
alert("Data Sent");
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert("Status: " + textStatus);
alert("Error: " + errorThrown);
}
});
});
出现错误。错误处理程序显示状态:parsererror,然后是错误:SyntaxError:Unexpected end of input