Unexpected token from webservice

Posted by Kenneth B on Stack Overflow See other posts from Stack Overflow or by Kenneth B
Published on 2012-07-03T19:37:42Z Indexed on 2012/07/03 21:16 UTC
Read the original article Hit count: 189

Filed under:
|
|
|

I got this little snippet where I call a Battlefield 3 stat server. If you visit this URL, which I'm calling, we'll be getting no errors: http://api.bf3stats.com/pc/server/?output=json&id=534f7035-cef8-48aa-b233-8d44a0956e68

But when I try to get the stats via Ajax call, I get:
Uncaught SyntaxError: Unexpected token :

... In my console I can see that the response is coming in, as when I visit the url, but I can't get the data with the ajax call... Is there something wrong with my code???

$.ajax({
        type: "GET",
        url: "http://api.bf3stats.com/pc/server/?output=json&id=534f7035-cef8-48aa-b233-8d44a0956e68",
        dataType: "jsonp",
        success: function(response) {
            console.log(response);
        }
    });

Thank you in advance...

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery