web page freezes when javascript sends data to the applet
<p>I have an applet and a JavaScript function.The JavaScript function is being called by the applet.I have saved the applet as .class and I have given the location i the applet tag.when i load the web page and click the button which will call JavaScript function and trigger it to send data to the applet the web page freezes forever.What i can do to overcome this problem?
    Here is the applet tag on the webpage.
    
</p>

<pre><code>Here is javascript function which sends data to applet
 function PrintReceipt(myApp)
{
var totalElem=document.getElementById("total");
 var taxElem=document.getElementById("tax");
//var changeElem=document.getElementById("change");
 //var subtotalElem=document.getElementById("subtotal");
//var discountElem=document.getElementById("discount");
//var salesitemsElem=document.getElementById("product");
var myApp = document.applets['jposprint'];
 myApp.ReceiveData(taxElem.innerHTML + totalElem.innerHTML);
alert("js k.");
}
 Here is the applet code which receives the data.
public void ReceiveData(String DataFromJS,Graphics g)
  {

  JSObject window=JSObject.getWindow(this);
   window.call("PrintReceipt()", new Object[] {DataFromJS})   ;
   System.out.print(DataFromJS);
  //System.out.println(DataFromJS);
 //return DataFromJS;


 // g.setColor(Color.black);

//Total=(int)window.eval("PrintReceipt()");
 //UserName=(String)window.eval("PrintReceipt()");


  }

}



Regards Masiela.
</code></pre>
