Error: MIME type ('application/json') is not executable, and strict MIME type checking is enabled with YQL statements?

Error: MIME type ('application/json') is not executable, and strict MIME type checking is enabled with YQL statements?

我正在尝试 运行 一个关于 YQL from Yahoo 的例子。这是我应该使用的代码:

<body>
<div id='results'></div>
<script src='https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20rss%20where%20url%3D%22http%3A%2F%2Frss.news.yahoo.com%2Frss%2Ftopstories%22&format=json&diagnostics=true&callback='></script>
</body>
<script type='text/javascript'>
function top_stories(o){
  var items = o.query.results.item;
  var output = '';
  var no_items=items.length;
  for(var i=0;i<no_items;i++){
    var title = items[i].title;
    var link = items[i].link;
    var desc = items[i].description;
    output += "<h3><a href='" + link + "'>"+title+"</a></h3>" + desc + "<hr/>";
  }
  document.getElementById('results').innerHTML = output;  
}
</script>

我读过其他有同样错误的问题,其中大部分给出了与此类似的答案

By adding a callback argument, you are telling jQuery that you want to make a request for JSONP using a script element instead of a request for JSON using XMLHttpRequest. JSONP is not JSON. It is a JavaScript program.

我的问题是我正在使用 JavaScript,但我在上面的脚本中找不到我期望 JSONP 的代码。我是一个完全的新手,所以我可能犯了一个愚蠢的错误。上面的代码有什么问题?谢谢

第 3 行的 <script> 元素正在请求 JSONP。它只是硬编码而不是用 JS 添加(这对于 JSONP 来说是正常的)。

YQL 正在交付 JSON 因为您已经说过 callback= 然后在没有实际提供回调函数名称的情况下停止。