onLoad callback is called twice in IE (and once in FF). Perhaps same problem s applicable to other callbacks too. This is annoying as developer need to make keep state in his code to detetc if callback was called already. Here is sample html page to reproduce the problem using Fish sample from JavaFX: ��<html><head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <script> var READY = 2; function callApplet() { var a = document.getElementById("my"); try { // try/catch is not needed for JavaFX applet if (a.status < READY) { //applet not ready, register itself a.onLoad = callApplet; log("A: status = "+a.status); return; } log("B: status = "+a.status); } catch(err) {window.alert("OOO");} //JRE6 or earlier and no JavaFX //either applet is ready or nonblocking access is not supported log("C: call it!"); } function log(msg) { var a = document.getElementById("log"); var p = document.createElement("p"); p.appendChild(document.createTextNode(msg)); a.appendChild(p); } var deployJava = { perfLog: function() {}, hideSplash: function() {} } </script> </head> <body onload="callApplet()"> Log: <br> <div id="log"></div> <APPLET id="my" style="LEFT: 0px" height="200" width="300" code="dummy.class"><PARAM value="Fish.jnlp" name="jnlp_href" /><PARAM value="true" name="java_status_events" /><PARAM value="application/x-java-applet" name="type" /><PARAM value="2.0+" name="javafx_version" /><PARAM value="true" name="separate_jvm" /><PARAM value="my" name="javafx_applet_id" /><PARAM value="true" name="scriptable" /><PARAM value="-Djnlp.fx.perf=true" name="java_arguments" /></APPLET> </body></html> ============== Problem is reproducible if you see following log: ��A: status = 1 B: status = 2 C: call it! B: status = 2 C: call it!
|