Ok, I'm a little newbie when it comes to jQuery and json. If I use json as the return type, can I get a Text response from an XMLHttpRequest object?
here is the code i use:
json response: {"clients": []} $.ajax({ type: "POST", url: "/myurl/whatever.php", data: myData, dataType: "json", success: function(msg){ status.html(msg[0]); }, error: function(msg) { status.html("Error: " + msg[0]); } });
is using msg [0] correct if i want to output json answer or am i missing something?
how can I use the above code with XMLHttpRequest to get status, responseText, etc.
Thank you all!
jake m
source share