关于ajax中post请求 与 jquery中的post请求
亮大人 2014-04-02 11:54:56 ajax post请求可正常运行
$.ajax({
type: "Post",
url: "SurveyDetail.aspx/ViewAnswer",
contentType: "application/json; charset=utf-8",
dataType: "json",
data: "{ 'surveyId': '" + surveyId + "', 'questionId': '" + questionId + "' }",
success: function (data) {
$("#result").html(data.d);
},
error: function (err) {
//alert(err.responseText);
return;
}
});
我想简化代码,然后想使用jquery中的post,但是这样运行失败
$.post("~/Administrator/survey/SurveyDetail.aspx/ViewAnswer", "{ 'surveyId': '" + surveyId + "', 'questionId': '" + questionId + "' }", function (data) {
alert(data);
//$("#result").html(data);
},"json");
请大家帮忙看下,谁遇到过这种问题,怎么解决啊 ?! 赞美好人。。。