SVG:Script: Difference between revisions

148 bytes added ,  22 November 2005
Line 32: Line 32:


When using SVG inside HTML, Adobe's SVG Viewer 3.0 automatically includes a window property called "svgDocument" that points to the SVG Document. This is not the case for Mozilla's native SVG implementation, and therefore using window.svgDocument does not work in Mozilla. A suggestion is to use <pre>var svgDoc=document.embeds["name_of_svg"].getSVGDocument();</pre> to get a reference to an embedded SVG document instead.
When using SVG inside HTML, Adobe's SVG Viewer 3.0 automatically includes a window property called "svgDocument" that points to the SVG Document. This is not the case for Mozilla's native SVG implementation, and therefore using window.svgDocument does not work in Mozilla. A suggestion is to use <pre>var svgDoc=document.embeds["name_of_svg"].getSVGDocument();</pre> to get a reference to an embedded SVG document instead.
Alternatively, simply using document.getElementId("''svg_elem_name''") will give the same result, though I've only tested this in FireFox 1.5 RC3.


== inter-document scripting - calling JavaScript functions ==
== inter-document scripting - calling JavaScript functions ==