Javascript: JScript file parsed as text on Apache server and can't be run

被刻印的时光 ゝ 提交于 2019-12-13 04:42:10

问题


I was working for a client, and his server doesn't allow running javascript. I tried to re-create and re-upload the JS files but the server keeps changing the file type into text. What's up with this? See screenshot below...


回答1:


You need to add the .js file MIME type in your Apache http.conf with AddType:

AddType application/x-javascript .js

This will tell Apache to serve .js files with the application/javascript type you need.



来源:https://stackoverflow.com/questions/22100557/javascript-jscript-file-parsed-as-text-on-apache-server-and-cant-be-run

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!