Resource interpreted as other but transferred with MIME type text/javascript?

homework picture homework · Sep 6, 2009 · Viewed 46.4k times · Source

I keep getting "Resource interpreted as other but transferred with MIME type text/javascript.", but everything seems to be working fine. This only seems to be happening in Safari 4 on my Mac.

I was advised to add "meta http-equiv="content-script-type" content="text/javascript" to the header, although that did nothing.

Answer

jcampbell1 picture jcampbell1 · Nov 2, 2010

The most common way to get the error is with the following code:

<img src="" class="blah" />

A blank url is a shortcut for the current page url, so a duplicate request is made which returns content type html. The browser is expecting an image, but instead gets html.