Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debug message "Resource interpreted as other but transferred with MIME type application/javascript"

OK, I understand what the messages means, but I'm really not sure what's causing it. I'm using Safari and the Web Inspector on Mac OS X, by the way.

I've got the following in my document head:

<script src="http://local.url/a/js/jquery.js" type="text/javascript"></script> <script src="http://local.url/a/js/jquery.inplace.js" type="text/javascript"></script> 

jquery.js is handled fine, but the other file causes the warning. It also seems that the javascript in this file never gets executed.

The file is being served via mod_deflate, so it is gzip encoded, but so is the other file.

Has anybody got any ideas what's causing this, or how to resolve it?

Cheers all, Gaz.

like image 973
Gaz Avatar asked Mar 18 '09 13:03

Gaz


People also ask

Can MIME type be faked?

MIME types also can not be misleading. MIME types are the authoritative declaration of what something is. If it's not that, then there is nothing misleading, it's simply invalid. Framing this as "MIME spoofing" is about as sensible as calling a buffer overflow in some font renderer "machine code spoofing".

What is a MIME type and what is it used for provide an example?

MIME types enable browsers to recognize the filetype of a file which has been sent via HTTP by the webserver. As a result the browser is able to choose a suitable displaying method. Common MIME types are for example text/html for html-files or image/jpeg for jpeg-files.

What is MIME type?

A MIME type (now properly called "media type", but also sometimes "content type") is a string sent along with a file indicating the type of the file (describing the content format, for example, a sound file might be labeled audio/ogg , or an image file image/png ).


1 Answers

An image with an empty "src" attribute generates this error under Windows-Chrome:

<img src=""> 

... whereas ...

<img> 

... does not.

I arrived here because my ajax resultset was returning "src" data which was empty yet the img was still being inserted into the page.

like image 191
John Mee Avatar answered Sep 30 '22 15:09

John Mee