【发布时间】:2013-07-26 05:54:47
【问题描述】:
请帮忙。在我的 ajax 调用中出现 Invalid JSON 原语错误,下面的 ajax 调用有什么问题
$.ajax({
url: "/Precedent/ShowPartyContents", type: "POST",
contentType: 'application/json; charset=utf-8',
dataType: 'html',
data:{'partyId':party,'PartySelCombo':valueFrom,'DocumentId':DocId},
sucess:function(result){
alert("String"+ result);
//jq("#PartyTagContentArea-"+ pass cheyyenda id).html(data).fadeIn();
},
error : function( ts ){
alert("error :(" + ts.responseText);
}
});
谢谢
【问题讨论】:
-
你在哪一行得到这个错误?
-
您也有错字。
success,不是sucess。 -
我从 ajax 错误函数中得到了这个错误,也感谢你指出这个拼写错误。
-
@Saeed 是我的数据:{'partyId':party,'PartySelCombo':valueFrom,'DocumentId':DocId} 行正确吗?这是传递这些参数的正确方法吗?
-
@saeed JSON.Stringfy 解决了我的问题,感谢您的时间...