Chrome "Resource interpreted as image but transferred with MIME type text/html."

4,076 views
Skip to first unread message

Ray J.

unread,
Jun 1, 2010, 4:17:14 PM6/1/10
to SVG Web
SVG Web had been working fine for me until Chrome moved from version 4
to version 5. Now nothing shows up and I receive the error: "Resource
interpreted as image but transferred with MIME type text/html."

I am dynamically generating the SVG image using
document.createElement(svgns,"svg").

Is anyone else experiencing this?

Jamie Love

unread,
Jun 1, 2010, 5:26:40 PM6/1/10
to svg...@googlegroups.com
I'm using Google Chrome 5.0.375.55 under Windows 7, along with the
protovis library (from http://gitorious.org/protovis/jloves-protovis).
This uses SVGWeb to generate dynamic SVG.

It works for me without error, so I know it can be made to work.

> --
> You received this message because you are subscribed to the Google Groups "SVG Web" group.
> To post to this group, send email to svg...@googlegroups.com.
> To unsubscribe from this group, send email to svg-web+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/svg-web?hl=en.
>
>

--
Jamie Love
Looking for custom software development? Contact us at www.nsquaredsoftware.com.

Bradley Neuberg

unread,
Jun 1, 2010, 6:42:28 PM6/1/10
to svg...@googlegroups.com
Perhaps Chrome is doing more robust checking on MIME types whereas before it was doing 'content sniffing'. Sounds like you are sending a JPG, PNG, GIF, etc. file but don't have the right mime types set on your server. Maybe you also haven't added the SVG mime type to your server; I bet thats it.

Ray J.

unread,
Jun 2, 2010, 12:31:57 PM6/2/10
to SVG Web
Finally fixed the problem, but interestingly enough, it had nothing to
do with the MIME error.

I create a dynamic SVG on a square "canvas" and used a javascript
variable named "screen" to hold the width & height. I guess "screen"
must be a reserved keyword in Chrome, because as soon as I changed the
variable name, the SVG showed up.

I still get the MIME error, but the page displays without issues.

I find it strange that if "screen" is a reserved word, no JavaScript
error was reported on the console.

Bradley Neuberg

unread,
Jun 2, 2010, 1:43:18 PM6/2/10
to svg...@googlegroups.com
Interesting; I do believe that screen is a reserved keyword. I'm not sure if browsers actually give errors if you use reserved keywords -- they just act weird.


--

jmarranz

unread,
Jun 3, 2010, 3:58:21 AM6/3/10
to SVG Web
No, screen is not a reserved keyword, I'm sure your problem is due to
not declaring screen as a local variable (var screen = ...) then
because "window" is the default global context object, something like
screen = ... is interpreted as window.screen = ... and because screen
is a readonly basic object of browser engine you have a problem.
> > svg-web+u...@googlegroups.com<svg-web%2Bunsu...@googlegroups.com>
> > .
Reply all
Reply to author
Forward
0 new messages