Hi Mark,

Give this a try -- comments included (simple SVG file follows):

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>

<html xmlns="http://www.w3.org/1999/xhtml"; >
<head>
    <title>Untitled Page</title>
    <script type="text/javascript">
    var svgdoc, textmap,showHide
 xmlns="http://www.w3.org/1999/xhtml";
    function prepare()
    {
       // svgdoc=document.sv.getSVGDocument();
  svgdoc=document.getElementById("sv").getSVGDocument();

//(I think retrieving an embed by id is probably a bit more robust than doing 
it by DOM1 methods)
        textmap=svgdoc.getElementById('names')
    }

    function visibleText(showhide)
    {
      alert(showhide+textmap.nodeName)
//this is just to make sure the textmap object was properly identified
        textmap.setAttributeNS(null,"x", 200);
      textmap.setAttributeNS(null,"visibility", showhide);

//using setAttributeNS rather than setAttribute is consistent with the SVG spec.
//neither IE/ASV, Opera, nor FF requires it, but some browser somewhere 
sometime might

    }

    
    </script>
</head>

<body onload="prepare()">
<embed id="sv" src="testing.svg" width=400 height=200>
<!--
<object> doesn't allow scripting in IE/ASV
<iframe> would be another way, but there are some oddities
<embed> is not how the spec says to do it, but it works in IE/FF/OP/Safari
-->

</embed>
  <form name="form">
  show<input id="show" type="radio" name="visible" checked="checked"
onclick="visibleText('visible')"/><br />
    hide<input id="hide" type="radio" name="visible"
onclick="visibleText('hidden')"/>

</form>
</body>
</html>

-----------------------svg---------
<svg xmlns="http://www.w3.org/2000/svg"; width="100%"
xmlns:xlink="http://www.w3.org/1999/xlink"; >
<script><![CDATA[
sampleVar="unnecessary";
//]]>
</script>
<text font-size="12"  x="5" y="20" id="names">sample text</text>
</svg>

----------------

Hope this helps and sorry if any of my old code has sent you barking up wrong 
DOM trees,

David






  ----- Original Message ----- 
  From: mark_alsisto 
  To: [email protected] 
  Sent: Monday, October 08, 2007 2:47 AM
  Subject: Re: [svg-developers] SVG with html control



  hi,
  can you help me see what's wrong with this...i cant seem to get it
  right(slow learner).



[Non-text portions of this message have been removed]



-----
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/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/svg-developers/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> 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