IE9 imports inline SVG <image> elements

I use this method to import an SVG document to a page, and it works very well, but in IE9 none of the tags <image>work after import (they appear as broken images, even if their attribute is xlink:hrefcorrect). Why is this happening, and is there any way around it? Here is a simple test page . It works fine in Chrome, FF, etc., but not in IE9.

+3
source share
2 answers

The js implementation importNodepresented in this answer does not correctly set attributes with a name extension, it should use setAttributeNSfor proper installation xlink:href. This other importNode implementation seems to handle this, have you tried using this?

+2
source

Apparently, if I omit xlink:and just use it href, if it fixes the problem in IE9, but interrupts it in Chrome, etc. Weird! If anyone knows why, I would be happy to accept your answer. See test 2 .

Addition href , in addition to xlink:href fixes the problem everywhere.

+5
source

All Articles