When trying to invoke methods of a Java applet using JavaScript, I encounter an issue that requires the site to be added to trusted sites and security set to low in order for it to work properly. Otherwise, an error is thrown:
Microsoft JScript runtime error: Object doesn't support property or method 'myMethod'
I am wondering how I can resolve this issue.
In Chrome, a prompt appears asking if I want to execute the applet.
Snippet of the full code used:
<html>
<head>
<script type="text/javascript">
function getKey() {
var key = document.myApplet.myMethod();
}
</script>
</head>
<body onload="getKey()">
<applet id="myApplet" archive="myApplet.jar" code="myApplet.class" width="0" height="0"></applet>
</body>
</html>