In FF and all, my javascript works fine. But in Chrome it gives this message:
Resource interpreted as script but transferred with MIME type text/plain.
I have checked all the script tags and they all have the MIME type="text/javascript"
. It even says so with jquery and jquery ui. What is wrong with Chrome?
What's the problem and the fix for this? Is it something I have to change in the 'options' of the browser or is it from the server, or do I have to tweak my code?
I had this problem and I figured out how to fix it.
It happens when the style (CSS) file is in a different encoding from the PHP file that references the .css file
For example, using jQuery.js in Unix encoding and using index.php in UTF-8 will cause this problem so you have to make them both UTF-8 or any other encoding as long as it the same.
I was having the same issue when trying to change a background images in a array through javascript (jQuery in this case).
Anyway.
Instead of this:
do this:
Chrome javascript gets screwed when trying to parse a variable inside an element structured with ' . In my case it stopped just before the image array being inserted. Instead of parsing the image url + image name (inside the array), it was parsing just the image url.
You probably need to search inside the code and see where it happens. FF, IE and all other don't have this problem.