使用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