Hi Michael,

mlindeboom <[EMAIL PROTECTED]> wrote on 05/11/2006 03:10:26 PM:

> When I load the following svg file I get an error. It seems that if a 
group
> or other element  is created using code, the getElementById() function
> cannot find it later. Is this true or is there something else wrong with 
the
> script? 

   There are several things wrong with the file/script..

> <svg  width="500" height="500" onload="main(evt)"> 

   First you really need to declare your namespaces:
<svg  width="500" height="500" onload="main(evt)"
      xmlns="http://www.w3.org/2000/svg";> 

>   var node = mydoc.createElement('g'); 

   Second you almost certainly want:
   var SVGNS = "http://www.w3.org/2000/svg";;
   var node = mydoc.createElementNS(SVGNS, 'g');

   Unless you really want to create an element in
the no-name namespace called 'g' that isn't an SVG
'g' element...

>   var node = xxp1.createElement('text'); 

   Third, the 'g' element doesn't have createElement
(or createElementNS) that method is on the SVGDocument:
    var node = mydoc.createElementNS(SVGNS, 'text');

   Good luck!

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to