News for hackers. Stuff that matters.
Re:Evil Icons – Lightweight SVG icons for your web project by dmlorenzetti on Thursday December 11, 2014 @11:01AM (#8735449)
According to Eisenberg & Bellamy-Royds' (excellent) "SVG Essentials", you should be able to create a fallback by using an <object> tag. Assuming that works (I haven't tried it), it could be a more direct approach than Javascript.

The <object> element is the general-purpose way of embedding external files in HTML and XHTML... Any content in between the [start and end tags] will be rendered only if the object data itself cannot be displayed.

Re:Evil Icons – Lightweight SVG icons for your web project by lysyi3m on Thursday December 11, 2014 @11:49AM (#8735715)
It seems that using of <object> - not the best solution. For example in construction like <object data="image.svg" type="image/svg + xml">   <img src="fallback_image.jpg" /> </object>

fallback image will always be loaded. To avoid this you need to use additional tricks like conditional comments... We need some more elegant trick to do that :)

Re:Evil Icons – Lightweight SVG icons for your web project by organsnyder on Thursday December 11, 2014 @11:11AM (#8735511)
Interesting idea, and I don't doubt that it would work (though I also haven't tried it).

I prefer to keep my HTML semantic when I can, and <img/> is more accurate than <object/>. Since SVG support is now over 90% of deployed browsers, I'd rather use Javascript for the edge cases.