Note that there are some explanatory texts on larger screens.

plurals
  1. POIssue Calling Applet Functions from Java Script
    text
    copied!<p>Every time I call a function of my applet from my Java Script, it throws an undefined exception. And my googling hasn't helped me at all.</p> <p>here is a link to the site I am am hosting it on right now: <a href="http://boba.dyndns-server.com:8080/BobaServer/CourseEntryPage.html" rel="nofollow">Host Site</a></p> <p>Here is my html for the embedding the Applet:</p> <pre><code>&lt;object type="application/x-java-applet" id="ClientApp" name="ClientApp" archive="Cal.jar" width="100" height="100"&gt; &lt;param name="code" value="Calendar_Algorithm" /&gt; &lt;param name="mayscript" value="true" /&gt; &lt;/object&gt; </code></pre> <p>And here is my java script code:</p> <pre><code>function test(){ document.writeln("&lt;p&gt; "+"Test"+" &lt;/p&gt;"); try{ var s=document.ClientApp.getGreeting(); document.writeln("&lt;p&gt; First: "+s+" &lt;/p&gt;"); }catch(err){ document.writeln("&lt;p&gt;Error Caught 1: "+err.description+"&lt;/p&gt;"); } try{ var s=document.getElementById('ClientApp').getGreeting(); document.writeln("&lt;p&gt; Second: "+s+" &lt;/p&gt;"); }catch(err){ document.writeln("&lt;p&gt;Error Caught 2: "+err.description+"&lt;/p&gt;"); } document.close(); } </code></pre> <p>I know it loads the applet because I can see the gui, and if it helps here is my init function</p> <pre><code>public void init() { try { SwingUtilities.invokeAndWait(new Runnable() { public void run() { JLabel lbl = new JLabel(getGreeting()); add(lbl); } }); } catch (Exception e) { System.err.println("createGUI didn't complete successfully"); } } </code></pre> <p>here is a link to my full code as well <a href="https://docs.google.com/document/pub?id=1PESG5iyav6mYzveLJK-lM2n2Grn4FmcN81lw8jZviZI" rel="nofollow">Code</a></p> <p>I got a feeling that the error is incredibly obvious, but I just can not see it.</p> <p>Any help would be great!</p> <p>P.S. The Applet class files are now in a signed jar file.</p> <p>Also This will be placed in the webapps folder of a tomcat server, but I am currently accessing it as a local file.</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