At 07:53 PM 11/28/2007, Domenico wrote:

>David, Erik,
>
>Sorry for my post being a little unclear.
>
>svgdoc.createElementNS(svgNS,"script")
>
>works for Opera and Firefox. One question was if there's an
>alternative that works for Safari and ASV as well.

I also was unable to get it working in ASV, whence all my dabbling 
about with DOM. In IE/ASV I was able to confirm that the <script> 
element had been created, but I could not find any way to locate the 
functions within it, nor to run said functions. With a "normal" 
inline script, the text of the script including its function are 
available as the nodeValue of the relevant tag, but such does not 
seem to be for .es/.js files.

The one workaround that comes to mind is the following -- embed the 
SVG in HTML and then load the script tag into HTML using DOM methods. 
The following works in IE, Opera, Safari and FF (with a simple 
alert("hello") statement in the alert.js file), so that could provide 
a workaround.

Of course if browsers other than Opera would support foreignObject, 
then we could insert a tiny HTML object in the middle of our SVG 
instead of the other way around and use it to work around what 
appears (to me) to be an IE/ASV limitation.

David

<html>
<head>
<script>
function build(){
         S=document.createElement("script")
         S.setAttribute("src","alert.js")
         document.documentElement.appendChild(S)
}
</script>
</head>
<body onload="build()">
</body>
</html> 



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