Skip to content Skip to sidebar Skip to footer

Javascript: Jscript File Parsed As Text On Apache Server And Can't Be Run

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.

Solution 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.

Post a Comment for "Javascript: Jscript File Parsed As Text On Apache Server And Can't Be Run"