I am having a problem while using cross-origin ajax.
I know it's a common question but did not get any solution for it yet.
$.ajax({
type: "GET",
url: url,
data: {id:id},
dataType: "jsonp",
crossDomain: true,
contentType: "application/jsonp; charset=utf-8",
async: false,
success: fnsuccesscallbackk,
error: function(xhr, error){
alert(error);
},
jsonpCallback: fnsuccesscallback
});
function fnsuccesscallback(data){
alert(data)
}
…but getting undefined response in callback function
.
Is there anything wrong what I am doing.