Link to home
Start Free TrialLog in
Avatar of seanmccully
seanmccully

asked on

not loaded because its MIME type, "application/x-javascript", is not "text/css"

Error: The stylesheet http://***.js?48349 was not loaded because its MIME type, "application/x-javascript", is not "text/css".
Source File: http://****.js?adxq=1239123669


The problem is that the JS file thats ?not? being loaded is not included in the Source File, and both source files are defined as script type='text/javascript'. A little perplexed on this one.
Probably not.

Open in new window

Avatar of Roger Baklund
Roger Baklund
Flag of Norway image

Can you provide some context? What kind of system is this? Can you show some source code?

The error message indicates that a CSS file was expected, but a javascript file was provided.
Avatar of seanmccully
seanmccully

ASKER

I cant really show the source, but when I see the error now it says the Source File is just the html page that contains the script tag. Does this eliminate the second JS as a problem? Also I can really show the source cause its kinda belongs to a third party vendor. But the javascript is included as such,


<script src="***" type="text/javascript"></script>

And when I view the headers on the file are

HTTP/1.x 200 OK
Date: Tue, 28 Apr 2009 20:18:37 GMT
Server: Apache/2.2.4 (Unix) PHP/5.2.3
Last-Modified: Tue, 28 Apr 2009 00:57:13 GMT
Etag: "d21a2-23d94-f17f2c40"
Accept-Ranges: bytes
Content-Length: 146836
Connection: close
Content-Type: application/x-javascript

Where is the error coming from? The browser, the web server, or the application? Or somewhere else? Where do you see the error? In the browser (on the page or in popup?), in web server logs, in application logs, or somewhere else?

A <script> tag is supposed to load a javascript into the browser, Content-type: application/x-javascript is normal for such a request. The error indicates a CSS file was expected, but a javascript was delivered by the web server. CSS files are normaly loaded with <link> tags or @import() statements within <style> tags.

I did not ask for ALL the source code, just a snippet to show us what you are doing. You can obfuscate paths, file names and any other identifiers.
What would you like to see, besides the script tag for loading the JS there isnt much else much involved. I even created a blank html file that simply loads the JS in the script tag and error is still generated. The javascript file just generates some html and appends to DOM. Which it does, but the browser (Firefox 3.0.9) is generating this error in the Error Console.
ASKER CERTIFIED SOLUTION
Avatar of Roger Baklund
Roger Baklund
Flag of Norway image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yes, I figured out what is causing the problem. Thanks!!.