Question

I want to get an Instagram follower list using jQuery, I am using the following code, but it is not working. What should I do?

$.ajax({
    url: "https://api.instagram.com/v1/users/1574083/follows?",
    dataType: 'GET',
    data: { access_token: token },
    success: function (result) {
        alert(result.meta.code);
        alert(result.data.username);
    },
    error: function () {
        alert("error");
    }
});
Was it helpful?

Solution

Try is like this

$.ajax({
    url: "https://api.instagram.com/v1/users/1574083/follows?",
    type: 'GET', // type instead of dataType
    dataType: 'json', // or jsonp for cross-domain 
    data: {
        access_token: token
    },
    success: function (result) {
        alert(result.meta.code);
        alert(result.data.username);
    },
    error: function () {
        alert("error");
    }
});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top