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

前端 未结 15 1892
旧巷少年郎
旧巷少年郎 2020-11-29 01:50

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\'v

相关标签:
15条回答
  • 2020-11-29 02:18

    It seems like a bug in Safari's cache handling policies.

    Workaround in apache:

    Header unset ETag
    Header unset Last-Modified
    
    0 讨论(0)
  • 2020-11-29 02:22

    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.

    0 讨论(0)
  • 2020-11-29 02:22

    I found out that the naming of my css files was in conflict with the proxy filters

    www.dating.com (which is not my site) was blocked and my css and js files were called dating.css and dating.js. The filter was blocking this. Maybe that is the case with some of you, working on corporates systems.

    0 讨论(0)
  • 2020-11-29 02:23

    It is because of the period in the file name. It is stupid, but anytime there is a period in the js file name you will get this error, and I have come across situations where it will actually prevent the js file from loading.

    0 讨论(0)
  • 2020-11-29 02:23

    Another common cause of this error on the Mac is Apple's quarantine flag.

    ls the directory containing the resource(s) in question. If you see the extended attribute indicator, i.e., the little @ symbol at the end of the permissions block (e.g. -rw-r--r--@ ) then the file could be quarantined.

    Try ls -la@e and look for com.apple.quarantine

    The following command will remove the quarantine:

    xattr -d com.apple.quarantine /path/to/file
    
    0 讨论(0)
  • 2020-11-29 02:23

    There seem to be many things that cause this. For me it was a lowercase rewrite rule in IIS. Changed the problem files (js and png) to lowercase and problem went away.

    0 讨论(0)
提交回复
热议问题