Adding an SVG object by DOM... help req

I'm trying to figure out how to adjust this code:

                <script>
                        alert("Hello World")
                        if (navigator.appName=="Netscape") {
                                var directTarget = event.getTarget();
                                var svgDocument;
                                if( directTarget.getNodeType() != 9 ) {
                                        // if not DOCUMENT_NODE
                                        svgDocument = directTarget.getOwnerDocument();
                                        } else {
                                        svgDocument = directTarget;
                                        }
                                }
                        var test = svgDocument.createElement('line')
                                test.setAttribute('x1', '-10')
                                test.setAttribute('y1', '-10')
                                test.setAttribute('x2', '10')
                                test.setAttribute('y2', '10')
                                test.setAttribute('style', 'stroke:red;')
                                test.setAttribute('id', 'test')
                                svgDocument.getElementById('graph').appendChild('test')
                        </script>

so it will create a new line in my SVG script.  What do I need to do to
fix this, and get it to write the line correctly?  I'm using NN4.72 w/
Adobe SVG plugin, and I want to write this for both NN and IE.  (The
Netscape-specific code is as provided by Adobe in the ReadMe notes.)

Alex Vincent
Lead Systems Administrator
Scents
San Francisco, CA

Received on Tuesday, 23 May 2000 12:10:08 UTC