Hi Shamjith,

Shamjith K V wrote:

what I want to try is how to embed a script like as given below.

<svg width="450" height="500" viewBox="0 0 450 500">
   <script type="text/ecmascript">
   function showDialog(msg) { alert(msg); }
   </script>

You do it the same way as for the rect more or less:

   String scriptText = "function showDialog(msg) { alert(msg); }";
   Element script = doc.createElementNS(SVGNS, "script");
   Node    text   = doc.createTextNode(scriptText);
   script.appendChild(text);
   doc.getDocumentElement().appendChild(script);

Note that I don't think squiggle will dynamically evaluate
script elements if they are added to the document at run time
(however you can 'eval' arbitrary strings if you need to).

I meant about the "<script> function ....</script>" part
Can you please help me in finding the solution for this.

   You might want to review the DOM level 2 APIs
(in particular "Core"):
        http://www.w3.org/DOM/DOMTR#dom2

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to