Java Error


I’ve tried to invoke the public method of an applet as following:

<applet id=“myApplet” …></applet>
var returnValue = myApplet.thePublicMethod();
alert( returnValue );

however, it seems doesn’t work??

I’m wondering if the pervious code fragment is actually the right way to invoke the desired method? If not, how to accomplish the task?

OS: Windows2000
Browser: MSIE6
Plug-in: Java Plug-in 1.3.1_01 (enabled)

Thanks for any help.