scripting SVG in HTML in <iframe> in HTML


The HTML(using embed)
<html><script>
function peruse(){
D=document.getElementById("E")
SVGDoc=D.getSVGDocument()
SVGRoot=SVGDoc.documentElement
who=SVGRoot.firstChild.nextSibling
whoName="<"+who.nodeName
whoHow=who.attributes.item(0)
whoNow=whoHow.nodeName
whoWhat=whoHow.nodeValue+">"
alert(whoName+" "+whoNow+"="+whoWhat)
}
</script><body>
<button onclick="peruse()">open</button><br>
<embed name="E" id="E" src="simplecircle.svg" width="50"
height="50">
</body></html>
The SVG
<svg xmlns="http://www.w3.org/2000/svg">
<circle r="50"/>
</svg>



The HTML(using object)
<html><script>
function peruse(){
D=document.getElementById("E")
SVGDoc=D.getSVGDocument()
SVGRoot=SVGDoc.documentElement
who=SVGRoot.firstChild.nextSibling
whoName="<"+who.nodeName
whoHow=who.attributes.item(0)
whoNow=whoHow.nodeName
whoWhat=whoHow.nodeValue+">"
alert(whoName+" "+whoNow+"="+whoWhat)
}
</script><body>
<button onclick="peruse()">open</button><br>
<object id="E" data="simplecircle.svg" width="60"
height="60"/>
</body></html>
The SVG
<svg xmlns="http://www.w3.org/2000/svg">
<circle r="50"/>
</svg>