Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery and Java applets
    text
    copied!<p>I'm working on a project where we're using a Java applet for part of the UI (a map, specifically), but building the rest of the UI around the applet in HTML/JavaScript, communicating with the applet through LiveConnect/NPAPI. A little bizarre, I know, but let's presume that setup is not under discussion. I started out planning on using jQuery as my JavaScript framework, but I've run into two issues.</p> <p><b>Issue the first: </b></p> <p>Selecting the applet doesn't provide access to the applet's methods.</p> <p>Java:</p> <pre><code>public class MyApplet extends JApplet { // ... public String foo() { return "foo!"; } } </code></pre> <p>JavaScript:</p> <pre><code>var applet = $("#applet-id"); alert(applet.foo()); </code></pre> <p>Running the above JavaScript results in</p> <pre>$("#applet-id").foo is not a function</pre> <p>This is in contrast to Prototype, where the analogous code does work:</p> <pre><code>var applet = $("applet-id"); alert(applet.foo()); </code></pre> <p>So...where'd the applet methods go?</p> <p><b>Issue the second:</b></p> <p>There's a known problem with jQuery and applets in Firefox 2: <a href="http://www.pengoworks.com/workshop/jquery/bug_applet/jquery_applet_bug.htm" rel="nofollow noreferrer">http://www.pengoworks.com/workshop/jquery/bug_applet/jquery_applet_bug.htm</a></p> <p>It's a long shot, but does anybody know of a workaround? I suspect this problem isn't fixable, which will mean switching to Prototype.</p> <p>Thanks for the 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