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

前端 未结 7 1772
长情又很酷
长情又很酷 2021-02-01 03:46

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

相关标签:
7条回答
  • 2021-02-01 04:18

    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 讨论(0)
  • 2021-02-01 04:19

    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.

    0 讨论(0)
  • 2021-02-01 04:26

    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.

    0 讨论(0)
  • 2021-02-01 04:29

    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.

    0 讨论(0)
  • 2021-02-01 04:30

    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+")"});
    
    0 讨论(0)
  • 2021-02-01 04:37

    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.

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