0

I'd like to ask a question for cross-domain Get request via Ajax. My ajax request is Like that

var currency_path="http://forex.cbm.gov.mm/api/latest";

$.ajax({  
    url: currency_path,  
    crossDomain:true,  
    type:"GET",  
    dataType:'jsonp',  
    async:false,  
    success: function(data){  
        console.log(data);  
 },  
error: function(){  
     alert('failure');  
}  
}).done(function(msg) {  
    console.log(msg);             
});

I got the response but i can't trace that Any Suggestion ?

Himanshu
  • 4,327
  • 16
  • 31
  • 39

1 Answers1

0

Look in your JavaScript error console:

Uncaught SyntaxError: Unexpected token :

You have dataType:'jsonp', but the URL is returning JSON.

You can't parse JSON as JSONP, there are different data formats.

Use some other technique to access the data.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335