cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Schwarz" <saschw...@hotmail.com>
Subject RE: Embedded JavaScript file inside dynamic SVG isn't working
Date Wed, 11 Feb 2004 03:46:13 GMT
Hi Guatam,
>hi Steve,
>  This is the same mail that i sent to your mail box directly.. i am
>extremely sorry for that.These mail is to the cocoon users group to
>rectify that mistake of mine.
It was my "bad" that started this; I must have sent directly to you.

>
>and wrt ur mail ,these is what i found:
>   I tried accesing the MoveCircle.js file from the client machine using
>these
>(url = http://localhost/cocoon/SvgApps/scripts/MoveCircle.js) and it
>works fine from there.So i think that sitemap seems to pick it up fine.
>  I tried removing the mime-type for .JS files and still got the same
>error Message Box which says "Microsoft JScript runtime error:Object
>expected line:1,column:0"

I'm not an SVG/JS expert, so I'd tackle this by trying to remove some
more variables. Since it looks like Cocoon is delivering all the pieces;
double check your paths are generated as you expect. If that is good
I'd modify your example to just run in the browser from the local filesystem
and not send any of it through Cocoon. Forgive me if you've tried this
already; I'd just try to figure out if this a Cocoon problem or an SVG 
problem...

>   I am not using the .js file from inside the html page which gets
>generated but from inside the .svg file...bcos the in the future, i
>would like the dynamically generated svg to just work as the main svg
>container which internally is built up of other svg image layers using
>the svg:image tag so that the final  svg image created  have there own
>user event handling based on what layer is currently active.
>   Since you said you have been using .JS from the html container
>page,have you been able to get hold of the handle to the svg doc
>element ?

Take a look at the O'Reilly SVG Essentials by J. David Eisenberg he
has a small section on ecmascript and SVG. There might be other
books that are better...

He does:
<script type="text/ecmascript">
<![CDATA[
function ecircle(evt) {
var circle=evt.getTarget();
circle.setAttribute("r", 50);
}

function scircle(evt){
var circle=evt.getTarget();
circle.setAttribute("r",25);
}
//]]>
</script>

<circle cx='150" y="175" r="25" fill="red"
onmouseover=ecircle(evt)"
onmouseout=scircle(evt)"/>

He states the JS onmouse*() handlers interact with the SVG using the evt SVG 
instance.

That is all I know!
HTH
Steve

_________________________________________________________________
Check out the great features of the new MSN 9 Dial-up, with the MSN Dial-up 
Accelerator. http://click.atdmt.com/AVE/go/onm00200361ave/direct/01/


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message