0

This is my code:

$.ajax({
    url: "https://api.instagram.com/v1/users/self/feed?access_token=" + TOKEN_HERE,
    type: "GET",
    processData: false,
    dataType: "text",
    success: function(data) {

        console.log(data);
    },
    error: function(xhr, status, data) {
        console.log("err", xhr.responseText, xhr.statusCode, data, status);
    }
});

It prints:

"err" "" 0 "" "error"

tamper data shows:

enter image description here

I even tried plain Ajax, no jQuery, and it did the same thing!

I see this question but it is apparently not the same problem as mine: jquery ajax error {"readyState":0,"responseText":"","status":0,"statusText":"error"} Because I tested this on w3schools html simulator and it led to the same result. So it cannot be that something is interfering with my async code.

Thanks..

Community
  • 1
  • 1
  • 1
    crossdomain or localhost, look here: http://stackoverflow.com/questions/14930207/jquery-ajax-returns-status-code-0-while-requesting-cross-domain – Raúl Martín Jun 09 '15 at 22:18
  • Oh wow I feel stupid thanks Raul, added dataType: 'jsonp', and it worked. –  Jun 09 '15 at 22:22

0 Answers0