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

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -