我正在使用JQuery進行Ajax調用。我用嗅探器來捕捉響應文本:JQuery響應爲空,但實際響應不是
{"error_code":0,"message":"SUCCESS","data":{"session_token":"3efd9dde-a839-4e91-9415-4c2f6cba5b7b"}}
但是,成功回調返回的響應爲空。任何人有任何想法? (請參見下面的jQuery代碼
jQuery代碼:?
$.ajax({
type: "GET",
url: "http://184.72.58.99/matchaapi/API/User/Login",
data: { email: emailval, password: pwordval, developer_key: devkey },
dataType: "json",
cache: false,
beforeSend: function(xhr) {
xhr.setRequestHeader("Content-Type", "application/json; charset=utf-8");
},
success: function(resp) {
alert(resp);
$("#status p").html(resp.message);
}});
是。就是這樣。完全忘記了這一點。非常感謝! – 2010-03-26 08:06:42
太好了。你能幫我打一個答案旁邊的綠色「接受」複選標記嗎?歡迎來到堆棧溢出! – 2010-03-26 15:31:07