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 localhost (or my server), the MIME type of the JS that are hosted on my web server is application/x-javascript. The JS from Google CDN (e.g. jQuery) is text/javascript.
I want to make my JS become text/javascript. In my .htaccess, I tried adding this: AddType text/javascript .js
, but it didn't change my MIME type.
Suggestions?
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With