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

Who is Participating?
Roger BaklundConnect With a Mentor Commented:
The html generated by the javascript, does it contain a <link rel="stylesheet" ... > tag or a <style type="text/css"> tag with an @import() statement within it?

The error means a javascript was returned from the server when a css file was expected.
Roger BaklundCommented:
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.
seanmccullyAuthor Commented:
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

Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

Roger BaklundCommented:
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.
seanmccullyAuthor Commented:
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.
seanmccullyAuthor Commented:
Yes, I figured out what is causing the problem. Thanks!!.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.