I would like to put emas scripts from my svg file to a separate file.
However, my svg file is an object in the html file as following:


Top level html file top.html

<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <title>Radio Buttons</title>
  </head>
  <body id="myHtml">
        <object type="image/svg+xml" data="svg.svg" id="page"
          width="1000" height="650" border="1"></object>
  </body>
</html>
Svg file svg.svg

<svg xmlns="http://www.w3.org/2000/svg"; width="100%"
   xmlns:xlink="http://www.w3.org/1999/xlink"; >
  <script type="text/ecmascript" xlink:href="script.js"/>

  <rect
width="1000" height="650" x="0" y="0" id="background" fill="white"
onmouseup="add_block(evt)"
           onmousemove="mouse_move(evt)"/>
  <text font-size="12pt" x="50" y="20" id="t1">Click something to move
it</text>
  <text font-size="12pt" x="80" y="40" id="t2">Click nothing to add
something</text>
</svg>
Script file: script.js

    <![CDATA[
        ...
        function xml () {
            var tg=document.getElementById("background")
            var o = tg.nextSibling
            return "<svg>\n" + child(tg) + "</svg>\n"
        }
        ...
    ]]>

It is not working for me.  However, if the script is inside of svg.svg as
following:

  <script type="text/ecmascript">
    <![CDATA[
        ...
        function xml () {
            var tg=document.getElementById("background")
            var o = tg.nextSibling
            return "<svg>\n" + child(tg) + "</svg>\n"
        }
        ...
    ]]>
  </script>

it works.  Could some one help?

Thanks,

Tak


[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