Skip to main content

How to use JSONP with the API?

I'm trying to call the people api through AJAX using jquery but the response doesnt seem to have a callback wrapper, which causes an error. here is some sample code:

function getPeople(){
data = {
"access_token" : token
};
$.ajax({
url: peopleIndexUrl,
type: "GET",
cache: false,
data: data,
dataType: 'jsonp',
success: function(data,textStatus,jqXHR){
console.log(data);
},
error: function(jqXHR,textStatus,errorThrown){
console.log(errorThrown);
}
});
}

 

 The call does seem to go through fine. Perhaps I have to change the callback? Thanks.

Share this post

Showing 1 reaction

How would you tag this suggestion?
Please check your e-mail for a link to activate your account.