javascript - Alert mesage before Java Applet, cause Browser no response -
i facing problem on put alert message "please accept java applet." before page loading java applet cause browser not responding. suspend java applet loading , ask user permission accept it.
<html> <head> <title>java example</title> </head> <script> alert("please accept java applet."); </script> <body> page<br> below see applet<br> <br> <applet code="myapplet.class" width=200 height=100> </applet> </body> </html>
please try that:
<html> <head> <title>java example</title> </head> <body> page<br/> below see applet<br/> <script> var result = confirm("please accept java applet."); if(result == true) { document.write("<applet code='myapplet.class' style='width:200px;height:100px;'> </applet>"); } </script> </body> </html>
could please write html code according standards.
edit: well, in case please use "alert" function instead of "confirm". script should like:
<script> alert("please accept java applet."); document.write("<applet code='myapplet.class' style='width:200px;height:100px;'> </applet>"); </script>
if answer have met requirements please mark it.
Comments
Post a Comment