Hi Martin,

Your tip works!  Now my document will work for Firefox, Opera and MSIE
+ ASV.

Thanks!

-- 
Kam-Hung Soh
http://kamhungsoh.blogspot.com - It Mostly Works
http://members.optusnet.com.au/khsoh - Software That Mostly Works

--- In svg-developers@yahoogroups.com, "Martin Honnen"
<[EMAIL PROTECTED]> wrote:
> One possible way (not sure there are others) is to get the svg element
> in the HTML DOM that IE implements, then access the SVG DOM document
> the Adobe plugin implements and then simply use the W3C DOM Level 2
> createElementNS the SVG DOM document implemented by Adobe provides,
> e.g. if you have
> 
> <div>
> <svg:svg width="200px" height="200px"
>          id="svg1">
>   <svg:circle cx="100" cy="100" r="30" fill="green" />
> </svg:svg>
> </div>
> 
> then you can do
> 
>   var svgElement = document.getElementById('svg1');
>   if (svgElement != null && typeof svgElement.getSVGDocument !=
> 'undefined') {
>     var svgDocument = svgElement.getSVGDocument();
>     var rect =
> svgDocument.createElementNS('http://www.w3.org/2000/svg', 'rect');
>     rect.setAttributeNS(null, 'x', '30');
>     rect.setAttributeNS(null, 'y', '30');
>     rect.setAttributeNS(null, 'width', '20');
>     rect.setAttributeNS(null, 'height', '20');
>     rect.setAttributeNS(null, 'fill', 'blue');
>     svgDocument.documentElement.appendChild(rect);
>   }
>





-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
---- 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/svg-developers/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to