Hi, Wei-
Try:
evt.target.firstChild.nodeValue = 'hello,where are you';
But that will only work if there is already a childnode there (such as a
space or CDATA entity). Otherwise, it's safer to do this:
var myText = SVGDocument.createTextNode('hello,where are you');
newLabel.appendChild( myText );
If you are sure there's a text node there and want to replace it, use the
first, or use the second with replaceChild instead of appendChild.
Regards-
Doug
[EMAIL PROTECTED]
www.vectoreal.com ...for scalable solutions.
zou wei wrote:
|
| Hi:
|
| the following code works at IE+adobe,
| but not in FF. should I use something other than setData()?
|
| thanks
| wei
|
| <?xml version="1.0" standalone="no"?>
| <svg width="10cm" height="3cm" viewBox="0 0 1000 300"
| xmlns="http://www.w3.org/2000/svg" version="1.1">
| <desc>Example text01 - 'Hello, out there' in blue</desc>
| <script type="text/ecmascript">
| <![CDATA[
|
| function show(evt){
| evt.target.firstChild.setData('hello,where are you');
| }
| ]]>
| </script>
|
| <text x="250" y="150"
| font-family="Verdana" font-size="55"
| fill="blue" onmouseover="show(evt);" >
| Hello, out there
| </text>
|
| </svg>
|
|
------------------------ Yahoo! Groups Sponsor --------------------~-->
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/KIlPFB/vlQLAA/TtwFAA/1U_rlB/TM
--------------------------------------------------------------------~->
-----
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/