Chrome says: Resource interpreted as Image but transferred with MIME type text/javascript: "<jquery google cdn url>"

StackOverflow https://stackoverflow.com/questions/13820791

  •  07-12-2021
  •  | 
  •  

In a webapp, I am using yepnope.js as a loader (mostly because of its ability to load CSS as well as JS).

However, for whatever gets loaded by yepnope, Chrome is giving the warning:

Resource interpreted as Image but transferred with MIME type text/javascript: <some js file>

or

Resource interpreted as Image but transferred with MIME type text/css: <some css file>

This is not creating any problems as far as execution is concerned, but what I don't understand is how is Chrome interpreting a pure JS or CSS file as an IMAGE.

And how to workaround this?

Also, whatever gets loaded from outside of YepNope, is loading perfectly without any warnings.

PS :: I don't have any extensions enabled. The only one enabled is PageSpeed.

有帮助吗?

解决方案

Sit back and relax, it's just a warning.

yepnope uses <img> to pre-load resources. That's why there is a warning.

Read preloadFile() in yepnope.js.

其他提示

This is answered by the yepnope team here: https://github.com/SlexAxton/yepnope.js/issues/32

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top