MIME type in Chrome error

前端 未结 1 381
陌清茗
陌清茗 2021-01-21 14:57

When I load my web application in Chrome it shows the folliwing in the console log:

Resource interpreted as Script but transferred with MIME type text/pla

相关标签:
1条回答
  • 2021-01-21 15:17

    theres an error with your server-sided code, the server sends "text/plain" when the browser expects "text/javascript"

    .. how to fix this depends on what server you use (lighthttpd / apache / nginx / etc) , but.. if you have some scripting language like PHP (which nearly all webservers has these days) , you can use that to customize the MIME.. like

    jsstuff.js.php

    <?php header("content-type: text/javascript");?>
    //javascript goes here!
    
    0 讨论(0)
提交回复
热议问题