使用jQuery 1.4.4版,我無法得到適當的JSON輸出,當我打電話或阿賈克斯.post的類似如下:JQuery的.POST功能dataType參數似乎沒有做任何事情
$.ajax({type: "POST", url: callbackUri, data: { cow: ["oh", "hello", "there"]}, success: returnFunction, dataType: "json"});
或以下內容:
$.post(callbackUri, { cow: ["oh", "hello", "there"]}, returnFunction, "json");.
HTTP請求的身體看起來像這樣在兩種情況下:
cow%5B%5D=oh&cow%5B%5D=hello&cow%5B%5D=there
這是PROBA bly一個非常簡單的配置問題。任何幫助表示讚賞!
非常好,謝謝。當它說「從服務器期望的數據類型」時,我誤解了文檔。我現在通過JSON.stringify(數據),它工作正常。 – cansado 2011-03-01 17:16:57