與ajax調用堆疊在一起。 我總是得到錯誤。我試過從服務器ArrayList返回,因爲我在我的一些項目中有一些方案。但結果是一樣的。 Json是有效的。 Staus 200 OK和永久性錯誤。Ajax調用。始終返回錯誤
這裏是我的客戶端代碼
$.ajax({
type: "POST",
url: "services.aspx/GetHexString",
data: "{'strGetParamsString':'LYALYA'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(msg) {
alert(msg.d);
},
error: AjaxFailed
});
服務器端邏輯:
[WebMethod]
public static string GetHexString(string strGetParamsString)
{
return "HI";
}
螢火顯示200個OK狀態。結果是{「d」:「HI」} http://jsonlint.com/說json是有效的。
有什麼不對?
我正在使用Jquery-1.3.2 – Ars
你得到了什麼錯誤? – herman
當前版本的jQuery是1.6.4 - 我建議你升級。 – Skilldrick