I am accessing a cross domain api using jquery ajax but I can't achieve it . Iam getting error as "uncaught syntaxerror : unexpected token <" in the console, How to fix this.
Code:
$.ajax({
url: "http://..............",
type:"GET",
dataType: 'jsonp',
crossDomain: true,
contentType:"application/javascript",
success: function (data) {
alert(data);
},
error: function (errorMEssage, Errtext) {
alert(Errtext);
}
});
Error:
uncaught syntaxerror : unexpected token <