title: Problem using AJAX with a Java Applet
body: <p>I currently have a Java Applet which contains a method callfromjs(). Javascript calls this method from the applet so that I don't have to deal with the clunky applet GUI, and then I can create the responses on the DOM easily from javascript. </p>
  
  <p>The problem is that the browser hangs while first loading the applet. To get around this, I figured I could use AJAX. The AJAX calls a PHP file which contains callfromjs(). The problem is that the request returns because it's PHP, and it doesn't wait for callfromjs() to retrieve the content.</p>
  
  <p>On to my questions:</p>
  
  <ol>
  <li>Is there a better way to handle this?</li>
  <li>If this method seems ok, how can I force the request not to return until the javascript is finished calling the method from the applet?</li>
  </ol>