SVG is alive and well
I have been working on a countdown timer for the 2010 New Years (work in progress) and decided to give SVG a try. And it works great in most browsers except IE of course. To work around this annoying limitation, I downloaded SVGWEB javascript library. This is an amazing library that detects IE and substitutes SVG with Flash.
Working with SVG is very easy since it becomes a part of your document DOM model. You can manipulate it with common used DOM methods: getElementById, getElementsByTagName and others.
December 16th, 2009 at 6:34 pm
Thanks for the nice comment! Do you have any demos up? If you have any questions with SVG Web feel free to contact me.
Best,
Brad Neuberg
December 16th, 2009 at 6:40 pm
I found one small bug that keeps things from working on IE: you should use getElementsByTagNameNS instead of getElementsByTagName:
svg_day1.getElementsByTagNameNS(svgns, ‘text’);
December 16th, 2009 at 7:02 pm
I found one other glitch that kept the Flash renderer from working; you re-use the same ID for the linear gradients and then reference them incorrectly. I’ve fixed both and put them here on my website if you want to see the source code:
http://codinginparadise.org/projects/svgweb-staging/tests/non-licensed/countdown/HYBRID__808.html
Just add ?svg.render.forceflash=true to see what things look like on IE:
http://codinginparadise.org/projects/svgweb-staging/tests/non-licensed/countdown/HYBRID__808.html?svg.render.forceflash=true
December 17th, 2009 at 12:48 am
Brad, thanks for looking into it. I was wondering myself why it was not working. I see what you mean- I changed the id of svgs, but did not change the references to rect fill=”url(#SVGID_1_)” .
I was wondering though if you had any ideas why the svg does not update in Safari on iPhone?
December 17th, 2009 at 1:54 pm
SVG Web doesn’t work on the iPhone; it used to but there has been a regression. I need to fix that.
December 17th, 2009 at 2:15 pm
I was just asking in general about iPhone support for svg. it seems to work somewhat, but it does not update time on my page.