W3C home > Mailing lists > Public > www-svg@w3.org > March 2014

SVG.innerHTML

From: David Dailey <ddailey@zoominternet.net>
Date: Sat, 8 Mar 2014 14:16:07 -0500
To: "'www-svg'" <www-svg@w3.org>
Message-ID: <001d01cf3b02$dc871f50$95955df0$@net>
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/66
336 
Received on Saturday, 8 March 2014 19:16:43 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:54:51 UTC