[Débutant] Problème simple
bonsoir,
j'aimerais exécuter une applet lors d'un clic sur une page php.
Voici mon code, très très simple:
PHP:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| <html>
<head>
<script type="text/javascript">
function TestApplett(){
alert(''+document.getElementById('test').afficheText());
}
</script>
</head>
<body>
<applet codebase="." code="TestApplet" name="test" id="test">
</applet>
<input type="button" name="bt_exec" value="Exécuter le script" onclick="TestApplett()"/>
</body>
</html> |
JAVA:
Code:
1 2 3 4 5 6 7 8 9 10 11 12
| import java.applet.Applet;
public class TestApplet extends Applet{
private static final long serialVersionUID = 1L;
public void afficheText(){
System.out.println( "salut !!");
}
} |
Le problème, c'est que mon alert renvoie un 'undefined'.
Pourquoi, comment résoudre ce problème?