【发布时间】:2013-11-08 22:48:55
【问题描述】:
您好,我将 json 发布到 django 网络服务很遗憾,即使我得到了结果 200,我已经更改了这种方法,但成功功能也没有触发数据类型为 "json" "text" "html" 但一无所获
网络服务协议是jsonrpc
感谢您的帮助
function displaySearchResult(response) {
if (response.result)
alert(response.result);
else if (response.error)
alert("Search error: " + response.error.message);
};
var url = "http://www.xxxxxxxx.com/django/json/";
var request = {};
request.method = "liveScore";
request.params = {};
request.params.date = "1392/08/04";
request.params.hash = "123";
request.id = 1;
request.jsonrpc = "2.0";
$.post(url JSON.stringify(request), displaySearchResult, "json");
【问题讨论】:
-
如果你的 dataType 是 json 并且你得到 200 但没有成功,这意味着你的服务器没有返回 json。
-
谢谢,但我想处理响应,即使它不是 json
-
textStatus中的displaySearchResult(data,textStatus,jqXHR)值是什么? -
需要 textStatus 吗?