Re: SVG.innerHTML

I've been placing my inline svg within a <DIV>. Then I just request the
div's innerHTML to expose all svg.
To extract individual elements, I use:
var mySVGElementString=new XMLSerializer().serializeToString(mySVGElement)


On Sat, Mar 8, 2014 at 2:16 PM, David Dailey <ddailey@zoominternet.net>wrote:

> Hi all,
>
>
>
> See http://srufaculty.sru.edu/david.dailey/svg/svgScaleinHTML.htm
>
> (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.
>
>
>
> Cheers
>
> David
>
>
>
> [1]
> https://groups.yahoo.com/neo/groups/svg-developers/conversations/messages/66336
>

Received on Saturday, 8 March 2014 22:39:32 UTC