SVG:Namespace: Difference between revisions

Line 27: Line 27:
for example, to dynamicly create an <image> element, do it like this:
for example, to dynamicly create an <image> element, do it like this:


svgns="http://www.w3.org/2000/svg"
svgns="http://www.w3.org/2000/svg"
xlinkns="http://www.w3.org/1999/xlink">
xlinkns="http://www.w3.org/1999/xlink">
newIM=document.createElementNS(svgns,"image")
newIM=document.createElementNS(svgns,"image")
newIM.setAttributeNS(null,"width",100)
newIM.setAttributeNS(null,"width",100)
newIM.setAttributeNS(null,"height",100)
newIM.setAttributeNS(null,"height",100)
newIM.setAttributeNS(xlinkns,"href","bild2.png")
newIM.setAttributeNS(xlinkns,"href","bild2.png")
73

edits