I'm trying to access a script as JSON via AJAX, which works fine on Safari and other browsers but unfortunately will not execute in Chrome.
(我正在尝试通过AJAX以JSON格式访问脚本,该脚本在Safari和其他浏览器上可以正常运行,但不幸的是无法在Chrome中执行。)
It's coming with the following error:(它带有以下错误:)
Refused to execute script from '*' because its MIME type ('application/json') is not executable, and strict MIME type checking is enabled.
(拒绝从“ *”执行脚本,因为其MIME类型(“ application / json”)不可执行,并且启用了严格的MIME类型检查。)
Here's the request:
(这是请求:)
$.ajax({
url: "http://some_url/test.json?callback=?",
type: "GET",
dataType: 'json',
cache: true,
success: function (data, status, error) {
console.log('success', data);
},
error: function (data, status, error) {
console.log('error', data, status, error);
}
});
Does anyone have a workaround for this?
(有人对此有解决方法吗?)
ask by Paul Nelligan translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…