This does not work in Safari:
<html> <body> <applet id="MyApplet" code="MyAppletClass" archive="MyApplet.jar"> <script type="text/javascript"> alert(document.getElementById('MyApplet').myMethod); </script> </body> </html>
myMethod is a public method declared in MyAppletClass .
When I first load the page in Safari, it shows a warning before the applet finishes loading (so it displays undefined in the message box). If I refresh the page, the applet is already loaded, and the warning displays function myMethod() { [native code] } , as you would expect.
Of course, this means that the methods of the applet are not available until it loads, but Safari does not block the launch of JavaScript. The same problem occurs with <body onLoad> .
I need something like <body onAppletLoad="doSomething()"> . How do I get around this problem?
PS: I'm not sure if this is relevant, but the JAR is signed.
java javascript safari javascript-events dom-events
Pedro d'quino
source share