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
The AddType
directive should be sufficient enough unless there's something that's forcing the type, but you can also try:
<Files "*.js">
ForceType text/javascript
</Files>
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).
you need to change your settings in mimes.types file found in your apache conf folder. Change
application/javascript js
to
text/javascript js
and restart apache, you should see the change