dynamic SVG icon not showing in IE

I'm rendering a dynamic icon by simply setting the SRC attribute of the IMG tag to data:... Works fine in Chrome but IE won't show it.

var icn = "data:image/svg+xml;utf8,<svg width='100' height='100' xmlns='http://www.w3.org/2000/svg'><path d='m10,38.85715l31.14282,28.85715l50.28576,-56.00001' fill='none' stroke-width='20' stroke='#09f'/></svg>";

$('body').append('<img width="20" height="20" src="'+ icn +'"/>');

Fiddle:

Anyone know why IE will not render the SVG?

Answers


Earlier versions of Internet Explorer require data uri's to be base64-encoded. I'm not sure if that's changed with IE11, but you don't specify which version of IE is causing problems.


Need Your Help

URL Rewriting and htaccess files

regex apache .htaccess mod-rewrite url-rewriting

Hoping someone can help. I use nibbler to check out my website to make sure it behaves well and one of the categories is URL FORMAT which