Tag: stackexchange api

JSONP请求返回错误:“未捕获的SyntaxError:意外的令牌:”

所以我试图用以下jQuery代码向Stack Exchange API发出请求: $.ajax({ type: ‘POST’, url: ‘http://api.stackoverflow.com/1.1/stats’, dataType: ‘jsonp’, success: function() { console.log(‘Success!’); }, error: function() { console.log(‘Uh Oh!’); } }); 但是当我在我的机器上打开文件,在FireFox或Chrome中,并发出请求时,我收到此错误: Resource interpreted as Script but transferred with MIME type application/json. Uncaught SyntaxError: Unexpected token : Uh Oh! 我不知道发生了什么。 我知道Stack Exchange API Gzips它的响应,这会导致任何麻烦吗?