views:

15190

answers:

12

OK, I understand what the messages means, but I'm really not sure what's causing it. I'm using Safari and the Web Inspector on Mac OS X, by the way.

I've got the following in my document head:

<script src="http://local.url/a/js/jquery.js" type="text/javascript"></script>
<script src="http://local.url/a/js/jquery.inplace.js" type="text/javascript"></script>

jquery.js is handled fine, but the other file causes the warning. It also seems that the javascript in this file never gets executed.

The file is being served via mod_deflate, so it is gzip encoded, but so is the other file.

Has anybody got any ideas what's causing this, or how to resolve it?

Cheers all, Gaz.

+1  A: 

seems to be a bug in safari / webkit. maybe this one, or any of these. try upgrading your safari. if there is no more recent stable version, try the 4 beta.

ax
A: 

It's probably a bug, same thing shows up on my Safari 4 on win.

Maiku Mori
+1  A: 

You need to use a tool to view the HTTP headers sent with the file, something like LiveHTTPHeaders or HTTPFox are what I use. If the files are sent from the webserver without a MIME type, or with a default MIME type like text/plain, that might be what this error is about.

artlung
+3  A: 

It is because of the period in the file name. It is stupid, but anytime there is a period in the js file name you will get this error, and I have come across situations where it will actually prevent the js file from loading.

wow, if that is the case it is very weird.
scunliffe
that may be one reason, but not the only reason that this error occurs.
Tchalvak
+3  A: 

This warning appears because no default script type is specified. Try adding the following directive to your HTML file:

<meta http-equiv="content-script-type" content="text/javascript">

You can read more about default scripting specifications here: http://www.w3.org/TR/REC-html40/interact/scripts.html#h-18.2.2.1

Steve
Putting in the http-equiv resolves the problem.
dalbaeb
Didn't work for me with Safari 4.0.3.
John
Neither Safari 4.0.2
JacobE
A: 

I had the same issue with a css file instead of javascript. (using the xitami webserver)

what fixed for me was adding under the MIME section of xitami.cfg:

css=text/css

dnndeveloper
+1  A: 

It seems like a bug in Safari's cache handling policies.

Workaround in apache:

Header unset ETag
Header unset Last-Modified
senz
+1  A: 

I renamed all of my JS files to not contain a period, but still not working for me in Windows Chrome. None of the JS files gets executed. Every other browser is fine. Any ideas?

LeGaS
+3  A: 

Hey... ;)

I don't thing is a bug, try adding the mime type to your .htaccess file for example put or add the following content to your .htaccess file (which should be in the same place of your .js or above folders)

#JavaScript
addType application/x-javascript .js

This solved my tree "Resource interpreted as other but transfered ... " Warnings. Everytime you have that kind of warning it means you don't have enough info in your .htaccess file.

BTW1: Since you are modifying .htaccess file, make sure you restart your server.

BTW2: I also could clear same warnings for GIF files in Safari 4 with this:

#GIF
addType image/gif .gif

BTW3: For other file types: see w3schools list

Regards

Ignacio

nacho4d
You don't need to restart your server after modifying .htaccess.
Liam
A: 

Hi,

I found out that the naming of my css files was in conflict with the proxy filters

www.dating.com (which is not my site) was blocked and my css and js files were called dating.css and dating.js. The filter was blocking this. Maybe that is the case with some of you, working on corporates systems.

vichingo
+2  A: 

An image with an empty "src" attribute generates this error under Windows-Chrome:

<img src="">

... whereas ...

<img>

... does not.

I arrived here because my ajax resultset was returning "src" data which was empty yet the img was still being inserted into the page.

John Mee
This was exactly the case for me.
maxfridbe
+2  A: 

I just got this and solved it locally on my mac. For some reason the javascript file in question had bad permissions. I noticed when I looked at it in firebug I was getting a 403. I hope that helps anyone.

m3talsmith