thomas.deweese wrote:
>
> You can use BridgeContext.getInterpreter(<mimetype string>);
> To get the javascript interpreter, then call
> script.Interpreter.bindObject(String name, Object obj);
>
> To bind an Java object into the JavaScript environment.
> You can then call methods on that Java Object from javascript.
>
Tried this, and it didn't quite work. I think I'm not doing something right.
Here's an example of what happens:
If I do this in my Java app...
Interpreter i = BridgeContext.getInterpreter("text/ecmascript");
i.bindObject("theObject", theObject);
And then run this script in the SVG file...
<script type="text/ecmascript">
theObject.someMethod();
</script>
It tells me the theObject is not defined. However, if I do this...
i.evaluate("theObject.someMethod();");
...then it works. So apparently, the script block in the SVG file is not
using the same interpreter as the one that I'm using in my Java program. How
do I get the interpreter that the SVG file's <script> block is using?
--
View this message in context:
http://www.nabble.com/How-to-send-event-from-embedded-Javascript-to-Java-tf4754551.html#a13658416
Sent from the Batik - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]