【问题标题】:Chrome says: Resource interpreted as Image but transferred with MIME type text/javascript: "<jquery google cdn url>"Chrome 说:资源解释为图像,但使用 MIME 类型文本/javascript 传输:“<jquery google cdn url>”
【发布时间】:2012-11-29 00:54:02
【问题描述】:

在 webapp 中,我使用 yepnope.js 作为加载器(主要是因为它能够加载 CSS 和 JS)。

但是,对于 yepnope 加载的任何内容,Chrome 都会发出警告:

资源被解释为图像但使用 MIME 类型传输 文本/javascript:&lt;some js file&gt;

资源被解释为图像但使用 MIME 类型传输 文本/css:&lt;some css file&gt;

就执行而言,这不会造成任何问题,但我不明白 Chrome 是如何将纯 JS 或 CSS 文件解释为 IMAGE 的。

以及如何解决这个问题?

此外,无论从 YepNope 外部加载什么,都可以完美加载,没有任何警告。

PS :: 我没有启用任何扩展。唯一启用的是 PageSpeed

【问题讨论】:

    标签: google-chrome yepnope


    【解决方案1】:

    坐下来放松一下,这只是一个警告。

    yepnope 使用&lt;img&gt; 预加载资源。这就是为什么会有警告。

    yepnope.js 中读取preloadFile()

    【讨论】:

      【解决方案2】:

      yepnope 团队在这里回答了这个问题: https://github.com/SlexAxton/yepnope.js/issues/32

      【讨论】:

        猜你喜欢
        • 2012-09-20
        • 2014-11-19
        • 2010-11-26
        • 2014-10-19
        • 1970-01-01
        • 2012-11-25
        • 2011-03-28
        相关资源
        最近更新 更多