使用Javascript:JScript的文件解析为Apache服务器上的文字,不能运行 [英] Javascript: JScript file parsed as text on Apache server and can't be run
本文介绍了使用Javascript:JScript的文件解析为Apache服务器上的文字,不能运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在为一个客户,他的服务器不允许运行的JavaScript。我试图重新创建和重新上传JS文件,但服务器不断变化的文件类型为文本。什么这个了?见下面的截图...
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...
推荐答案
您需要用将AddType添加.js文件的MIME类型在Apache的http.conf:
You need to add the .js file MIME type in your Apache http.conf with AddType:
AddType application/x-javascript .js
这将告诉Apache服务的.js
文件与应用程序/ JavaScript的类型,你所需要的。
This will tell Apache to serve .js
files with the application/javascript type you need.
这篇关于使用Javascript:JScript的文件解析为Apache服务器上的文字,不能运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文