MIME type in Chrome error

前端 未结 1 382
陌清茗
陌清茗 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

    
    //javascript goes here!
    

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