Is there some way to make java and javascript communicate, so that I get a javascript variable (an array of string) pointing on the result of a java method (an array of string) ?
can you clearly define how you'll use this? I'm not sure what you mean... you can have JavaScript write to the screen and include it as a parameter to an applet, if that's what you need... <p>Liam Morley<br><a href=mailto:lmorley@wpi.edu>lmorley@wpi.edu</a><br><a href=
You can also have <br><br>try <br>{<br>AppletContext context = getAppletContext();<br>URL u = new URL(getCodeBase(),javascript: "name of function"<br>context.showDocument(u,frame);<br>}<br>catch(Exception error)<br>{<br>showStatus("Error " + error);<br><br>}<br>}<br>this should allow you to load a javascript function when this peice of code is run, i am not positive how this works or if it does at all i just remember seing it some place.<br><br><br> <p>moses<br><a href=mailto:tmoses@iname.com>tmoses@iname.com</a><br><a href=
> get a javascript variable (an array of string) pointing on the result of a java method (an array of string) ? <br><br>"pointing on the result of a java method"<br><br>uh? I don't follow that at all. Is that a new technical term that I am not familiar with?<br><br>-pete
I'll try to make myself clearer (it will be all the easier since I thought a little about it ). So, I have a java applet. It deals with files, so I have d/l the java plugin and I call the applet via an OBJECT tag and not an APPLET tag.<br>What I would like to do is calling a function of the applet in a javascript and get its results. So, two problems :<br>- the normal syntax used for calling a java function is an applet is : document.applet_name.function_name, and it doesn't work because of the OBJECT tag ;<br>- can you actually write this :<br><script language="javascript"><br>function boo ()<br>{<br> var myVar=document.applet_name.funct(50);<br>}<br></script><br>with applet_name an applet and funct a java function :<br>int funct(int param)<br>{<br>// body...<br>}<br>?<br><br>
> can you actually write this :<br><br>Yes, I know, I do it all the time.<br><br>> so I have d/l the java plugin and I call the applet via an OBJECT tag and not an APPLET tag.<br><br>Well I don't know what 'd/l the java plugin' is but obviously that is what is creating the problem. <br><br>> Is there some way to make java and javascript communicate<br><br>Since you already know how to communicate to an applet from a javascript... I'm not sure what your question is?<br><br>If 'd/l the java plugin' is a binary product then I can think of 3 choices for your options.<br>1) You could stop using it<br>2) Find out from the makers of the product if they provide an interface from script to the product as a proxy to the nested applet.<br>3) Magic! (NOTE: I don't think this will work)<br><br>-pete
'd/l' stands for download. As for the java plugin (it's from Sun and it's free, by the way), I can't stop using it since it's needed if you want your applet to deal with files (else you have to put up with security restrictions ; it results in annoying exceptions such as 'AccessControlException'). And the only way to make IE use the plugin with the applet is calling it with an OBJECT tag. But then it's considered (the applet) like an ActiveX object, and I've never dealt with ActiveX before, and haven't found anything helpful on sun.java.com (ie, they explain how to use the plugin but not how to call a method from a script).<br>Unfortunately, my magic.txt file was in the bad place at the bad time the last time my drive went clean.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.