Set my JS MIME type to “text/javascript”

后端 未结 2 1073
滥情空心
滥情空心 2021-02-19 21:52

According to this: Javascript MIME Type, it seems that I should be serving my JS as \"text/javascript\". When I inspect the network communication between my browser and localhos

2条回答
  •  故里飘歌
    2021-02-19 22:50

    The AddType directive should be sufficient enough unless there's something that's forcing the type, but you can also try:

    
        ForceType text/javascript
    
    

    A better solution may be to look through your vhost/server config and all of the apache config files (that may be included by default in your config) for instances of application/x-javascript to see how that's being set. It may be better to just change it there instead of htaccess file, which may not have the neccessary override options (mod_mime's AddType and ForceType, for example, require the FileInfo AllowOverride option).

提交回复
热议问题