Excuse my lack of knowledge in many fundamental areas, but I am just learning how to create applets in java and how to allow interaction between the applet and the web page (javascript).
At the moment I have an applet with an init() and method1(). method1() just returns a string.
The applet is loaded on a web page and in javascript I literally reference the function:
<html>
<head>
<title>Testing Applet</title>
<script>
function hello() {
result = document.wplayer.method1();
alert(result);
}
</script>
</head>
<body>
<applet code = "player.Player" name = "wplayer" archive = "player.jar" width = "600" height = "400">
</applet>
<button onClick="hello();">Interact with app</button>
method1() just returns a string ("blah blah blah");
My question is, is this a safe way to do it and is it the most compatible?
Thanks!
Nick