2 function changeToSuccess(svgDocument
) {
3 var text
= svgDocument
.getElementById("text");
4 var rect
= svgDocument
.getElementById("rect");
6 // Due to limitations in the current SVG JS Bindings, we're changing the text in this roundabout way:
7 text
.removeChild(text
.firstChild
);
8 text
.appendChild(document
.createTextNode("SUCCESS"));
10 rect
.style
.fill
= "green";
14 var object
= document
.getElementById("object");
15 var embed
= document
.getElementById("embed");
17 changeToSuccess(object
.getSVGDocument());
18 changeToSuccess(embed
.getSVGDocument());
22 <body onload=
"didLoad()">
23 <p>This tests to see if HTMLEmbedElement.getSVGDocument() and HTMLObjectElement.getSVGDocument() work. You should see SUCCESS printed twice below this:
</p>
25 <EMBED id=
"embed" SRC=
"resources/getsvgdocument.svg" WIDTH=
"85" HEIGHT=
"20" /><br><br>
27 <OBJECT id=
"object" DATA=
"resources/getsvgdocument.svg" WIDTH=
"85" HEIGHT=
"20">FAILURE (no SVG support!)
</OBJECT>