Jump to content

Svg Problem


Galen
 Share

Recommended Posts

I created the SVG below to use with my web page, which works fine locally on every browser except IE, which works fine with the plug-in. When I upload the files to my school's web server (its linux, that's about all I know), it only works on IE. FF thinks it needs a plug-in, and Opera and Chrome just display the text of the .svg file.I tried the <embed>, <object> and <iframe> tags as found here:http://www.w3schools.com/svg/svg_inhtml.aspI did convert it to a JPEG sucessfully, and could possibly combine it with the picture it draws over, but the JPEG has a white background and the program I'm using (Paint.NET) doesn't seem to have a way to ignore the background color. I could layer the two pictures in CSS/HTML but then I have the same problem. I read GIFs have a transparent background by default but changing to that type didn't seem to accomplish anything.Would appreciate any advice on either approach. I could probably access photoshop through my school if I could get some idea of how to go about stripping the white from the layer.thanks<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN""http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" version="1.1"xmlns="http://www.w3.org/2000/svg"><line x1="33.2732%" y1="25.2435%" x2="35.7808%" y2="29.9512%" style="stroke:rgb(255,255,0);stroke-width:2"/><line x1="35.7808%" y1="29.9512%" x2="52.0289%" y2="35.9578%" style="stroke:rgb(255,242,0);stroke-width:2"/><line x1="52.0289%" y1="35.9578%" x2="43.2822%" y2="38.0682%" style="stroke:rgb(255,230,0);stroke-width:2"/><line x1="43.2822%" y1="38.0682%" x2="37.8720%" y2="36.6883%" style="stroke:rgb(255,217,0);stroke-width:2"/><line x1="37.8720%" y1="36.6883%" x2="27.6826%" y2="44.8864%" style="stroke:rgb(255,204,0);stroke-width:2"/><line x1="27.6826%" y1="44.8864%" x2="35.2570%" y2="42.0455%" style="stroke:rgb(255,191,0);stroke-width:2"/><line x1="35.2570%" y1="42.0455%" x2="42.0198%" y2="43.1818%" style="stroke:rgb(255,179,0);stroke-width:2"/><line x1="42.0198%" y1="43.1818%" x2="44.6348%" y2="47.0779%" style="stroke:rgb(255,166,0);stroke-width:2"/><line x1="44.6348%" y1="47.0779%" x2="27.6826%" y2="51.1364%" style="stroke:rgb(255,153,0);stroke-width:2"/><line x1="27.6826%" y1="51.1364%" x2="26.6005%" y2="54.8701%" style="stroke:rgb(255,140,0);stroke-width:2"/><line x1="26.6005%" y1="54.8701%" x2="17.9441%" y2="56.6558%" style="stroke:rgb(255,128,0);stroke-width:2"/><line x1="17.9441%" y1="56.6558%" x2="27.5023%" y2="64.7727%" style="stroke:rgb(255,115,0);stroke-width:2"/><line x1="27.5023%" y1="64.7727%" x2="25.6087%" y2="66.8019%" style="stroke:rgb(255,102,0);stroke-width:2"/><line x1="25.6087%" y1="66.8019%" x2="28.2236%" y2="67.6948%" style="stroke:rgb(255,89,0);stroke-width:2"/><line x1="28.2236%" y1="67.6948%" x2="20.6492%" y2="68.5065%" style="stroke:rgb(255,77,0);stroke-width:2"/><line x1="20.6492%" y1="68.5065%" x2="17.9441%" y2="56.6558%" style="stroke:rgb(255,64,0);stroke-width:2"/><line x1="17.9441%" y1="56.6558%" x2="17.9441%" y2="43.2630%" style="stroke:rgb(255,64,0);stroke-width:2"/><line x1="17.9441%" y1="43.2630%" x2="22.0018%" y2="38.2305%" style="stroke:rgb(255,51,0);stroke-width:2"/><line x1="22.0018%" y1="38.2305%" x2="19.9279%" y2="32.0617%" style="stroke:rgb(255,38,0);stroke-width:2"/><line x1="19.9279%" y1="32.0617%" x2="12.9847%" y2="30.3571%" style="stroke:rgb(255,26,0);stroke-width:2"/><line x1="12.9847%" y1="30.3571%" x2="28.9450%" y2="30.8442%" style="stroke:rgb(255,13,0);stroke-width:2"/><line x1="28.9450%" y1="30.8442%" x2="33.2732%" y2="25.2435%" style="stroke:rgb(255,0,0);stroke-width:2"/></svg>

Link to comment
Share on other sites

If it works on your server, and not on your school's web server, logic dictates it's a problem with the school's web server.In particular, I think the server may not be sending the proper MIME type, which confuses proper browsers. IE always sniffs the content anyway, so it's not affected.Inspect the response from the school's web server with a tool like Fiddler and/or Firebug, and check if the MIME type is "image/svg+xml". If it's not that, then you'll have to set up the server to deliver SVG files with this MIME type. For details, see this page from SVG.org.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...