Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 632
Binaek Sarkar Avatar asked Dec 16 '22 16:12

Binaek Sarkar


2 Answers

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.

like image 120
xiaoyi Avatar answered Feb 16 '23 03:02

xiaoyi


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

like image 31
mike Avatar answered Feb 16 '23 02:02

mike