开发者

Twitter json warning

开发者 https://www.devze.com 2023-03-03 09:38 出处:网络
everyone. When I get tweets count like this: $.getJSON(\'http://urls.api.twitter.com/1/urls/count.json?url=\'+ url +\'&callback=?\',fun开发者_StackOverflowction(data){

everyone. When I get tweets count like this:

$.getJSON('http://urls.api.twitter.com/1/urls/count.json?url='+ url +'&callback=?',fun开发者_StackOverflowction(data){
    return data.count;
});

Google Chrome shows this warning:

Resource interpreted as Script but transferred with MIME type application/json.

I tried a lot of options, but can find right one. How can I remove this warning?


You can't. It's a JSONP request, so it has to be interpreted as a script. However, twitter is serving it up as JSON. Hence the MIME type mismatch.

0

精彩评论

暂无评论...
验证码 换一张
取 消