$.ajax({
method: "POST",
async: false,
url: urllink,
dataType: "json", // or HTML.etc. it's important!
data: data,
success: function (msg) {
alert(data)
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert(XMLHttpRequest.status);
alert(XMLHttpRequest.readyState);
alert(textStatus);
}
})
options dataType VS type in ajax.