Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to add new parameters to a java applet to call another method from javascript?
    text
    copied!<p>I am using a java applet to call Web Services. This java applet is embedded in a html web page like this :</p> <pre><code>&lt;object classid="java:TEST3.class" codebase="lib/" type="application/x-java-applet" width="5000" height="50" archive="sTest11.jar" name="TEST3" id="TEST3"&gt; &lt;param name="TEST3" value="TEST3" /&gt; alt : &lt;a href="TEST3.class"&gt;TEST3.class&lt;/a&gt; &lt;!-- Safari needs this --&gt; &lt;param name="JAVA_CODEBASE" value="lib" /&gt; &lt;param name="BGCOLOR" value="000000" /&gt; &lt;param name="TEXTCOLOR" value="FF0000" /&gt; &lt;param name="TEXT" value="Test" /&gt; &lt;param name="SPEED" value="250" /&gt; &lt;param name="RANDOMCOLOR" value="1" /&gt; &lt;param name="mayscript" value="yes"/&gt; &lt;param name="scriptable" value="true" /&gt; &lt;/object&gt; </code></pre> <p>So when the web page is opened, the applet starts. I have a javascript file which calls the init() method to call a first web service. Then I retrieve datas, that I need to call a second web service. That's why I need here to add parameters to my java applet. If I use in javascript :</p> <pre><code>document.getElementById('TEST3').innerHTML +='&lt;param name="PARAM1" value="'+var1+'"/&gt;'; </code></pre> <p>and then</p> <pre><code>javascript:document.getElementById('TEST3').mymethod2(); </code></pre> <p>it does not work. The applet is not reloaded. (but it works if I put manually a parameter before loading the whole page, so the problem is the reloading of the applet in order to take the new parameter). I tried to call the stop() method, then the destroy() one, then another init() and then the request I want but it does not work.</p> <p>I manage to do my requests with different applets (with several innerHTML which create each one applet step by step), but it does not work exactly as I want, and I really would prefer use only one.</p> <p>If you have any idea, thank you very much for your help.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload