I have a web service which returns JSON data below code I am using for calling the web service.
jQuery.ajax({
url: 'http://localhost:5606/xyz',
type: "POST",
contentType: "application/json; charset=utf-8",
dataType: 'json',
data: '{"a":"b"}',
success: function(responses, textStatus, XMLHttpRequest) {
alert(responses);
},
error: function(xhr, err) {
console.log("readyState: " + xhr.readyState + "\nstatus: " + xhr.status);
console.log("responseText: " + xhr.responseText);
},
complete: function() {}
});
};
it return output of alert in success function as [object object] but I want it in proper json format.
console.log()notalertalertit, just log it in your console.