JQuery response is null but actual response is not
Posted
by Paul Petrick
on Stack Overflow
See other posts from Stack Overflow
or by Paul Petrick
Published on 2010-03-26T03:39:22Z
Indexed on
2010/03/26
3:43 UTC
Read the original article
Hit count: 253
jquery-ajax
I'm using JQuery to make an Ajax call. I used a sniffer to catch the response text: {"error_code":0,"message":"SUCCESS","data":{"session_token":"3efd9dde-a839-4e91-9415-4c2f6cba5b7b"}}
But the response returned on the success callback is null. Anyone got any ideas? (see jquery code below.
Jquery code:
$.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); }});
© Stack Overflow or respective owner