新手问题 关于 “MIME type ('application/json') is not executable” 报错

zicjin · July 13, 2014 · 23461 hits

我有一个 controoller 返回值是这样写的:

render :json => topics

没有写 respond_to,只输出 json。在浏览器访问这个路径返回的是正常的 json 结果。但是我在另一个页面中通过 jquery/jsonp 跨域 ajax 访问这个路径就 会出现这样的报错: because its MIME type ('application/json') is not executable, and strict MIME type checking is enabled.

我知道 jsonp 实际请求的 url 是类似这样的: http://192.168.33.10:3000/topic?callback=jQuery110207993173841387033_1405255955642&_=1405255955643 上面这个路径在浏览器访问返回结果也是正常的。

所以,这个“MIME type ('application/json') is not executable”是什么问题,怎样配置的?

No Reply at the moment.
You need to Sign in before reply, if you don't have an account, please Sign up first.