Re: SVG.innerHTML

On Mar 8, 2014, at 8:16 PM, David Dailey <> wrote:

> Hi all,
> See
> (doesnít work in IE or Win/Safari)
> Brian Birtles  taught me something [1] recently that I felt compelled to tell my students about the next day. (It involved replacing two animateTransforms with one).
> Anyhow, as a part of my example, I was interested in using SVG in-line in HTML5 Ė Iím always curious to see how that is coming along .  Just for fun I used :
>                                var O=document.getElementById("T1")
>                                var svgs=document.getElementsByTagName("svg")
>                                O.value=svgs[0].innerHTML
> I still remember fondly how ASV used to have something called printNode that serialized an SVG node for us, and I wanted to make it easy to show the students the relevant source code for the SVG examples (exemplifying different approaches).
> I really didnít expect this to work, but thought it would be very fun if it did. It worked in FF, Chrome and Opera 19. (not in IE10 or IE11 or Safari).
> My question: is this just a coincidence that it works right now in three browsers? Will it stop working in the future or might we expect that Safari and IE might one time join the others? I rather like being able to do this, since it simplifies the job of teaching.

Just to be clear. It works in Safari too. Just not in the Win version that seems not to be updated anymore (version 5.x on Win vs version 7.x on Mac). If you test in Safari please do it on Mac or iOS.


> Cheers
> David
> [1]

Received on Sunday, 9 March 2014 06:35:59 UTC