svgdoc undefined?

horstpeter
09-18-2007, 09:01 AM
Hi,
I have the following script in my svg, but always get svgdoc undefined back. I have a
<svg ... onload="Init(evt)">
in the svg tag.
<script type="text/javascript">
<![CDATA[

function Init(evt)
{
var svgdoc = evt.target.ownerDocument;
}

top.testHTML = setElementsStyle('leaderlines', 'g', 'opacity', 0)
function setElementsStyle(group,elem,prop,val)
{

var obj,objlength,objstyle;
obj=svgdoc.getElementById(group).getElementsByTagN ame(elem);
objlength=obj.length;
for(var i=0;i<objlength;i++)
{
objstyle=obj.item(i).style
objstyle.setProperty(prop,val,"");
}
}


What is wrong here, I can't find any error.
thank you
Ralf

 
Web mp2kmag.com
mapforums.com

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum