28

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.

7 Answers 7

71

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.

3
  • +1 Thanks for that, solved my issue. I would've thought having an empty src, the browser wouldnt load anything... but it still does. Fixed it by adding the src to a spacer.gif
    – Jason Jong
    Dec 17, 2010 at 4:55
  • 2
    Woot!! Thank you, this had been bugging me for the longest time. Jun 7, 2012 at 21:45
  • This took me 4 hours to track down, and it seems like a Safari bug
    – roman m
    Aug 2, 2013 at 19:36
3

i received this error due tu a missing element which a jquery plugin tried to call via js var btnChange i commented the none needed (and non existent) images out and the warning (google chrome dev tools) was fixed:

$(mopSliderName+" .sliderCaseRight").css({backgroundImage:"url("+btnChange.src+")"});
2

The (webkit-based) browser is issuing a warning that it has decided to ignore the mimetype provided by the webserver - in this case text/javascript - and is applying a different mimetype - in this case "other".

It's a warning which users can typically ignore, but a developer might find useful when looking for clues to a problem. For this example it might explain why some javascript wasn't being executed.

1

Your web server is sending the content with a certain MIME type. For example, a PNG image would be sent with the HTTP header Content-type: image/png. Configure your web server or script to send the proper content type.

1
  • Actually, I researched and I found that it causes no issues. It's something that Safari 4 tends to do... if I am not mistaken.
    – homework
    Sep 6, 2009 at 18:57
1

It does cause issues if your are calling a javascript that adds functionality, it is likely to fail, as it does for me. No real answers yet.

1

I was getting this error due to a script with bad permissions bringing up a HTTP 403 error. I gave it read and execute rights across the board and it worked.

0

There is a setting for the Apache MIME module where it misses adding the type for javascript, to resolve it, simply open the .htaccess file OR httpd.conf file, add the following lines

<IfModule mod_mime.c>
  AddType text/javascript .js
</IfModule>

Restart the apache server, issue will be resolved.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.