Re: Java7 Applet Status and Event Handlers
"Richard Maher" <maher_rj@hotspamnotmail.com> wrote in message
news:jnfrl8$o1d$1@speranza.aioe.org...
Ok, the onLoad, onError, and Status attributes all seem to do what it says
on the tin for Applets with Java7 and FireFox, Opera, and even IE.
Unfortunately on Chrome, document.getElementById("myApplet") still returns
before the Applet Object has formed enough so Status is "undefined".
Is there anyway to tell Chrome to wait? Does it have it's own onLoad, or
onReadyStateChange handlers for Applets?
In case anyone's interested in the outcome, for the sake of Chrome I had to
put a setTimeout poll (hate it!) on the
document.getElementById("appletId").status - for example: -
var waitForAppletDOM = function() {
if (window.console) console.log("in waitForAppletDOM");
var appletStatus = ((chanG.status||undefined) == undefined) ? 0
: chanG.status;
switch (appletStatus) {
case 0:
if (window.console) console.log("case 0");
setTimeout(waitForAppletDOM,250);
break;
case 1:
if (window.console) console.log("case 1");
chanG.onLoad = appletLoad;
chanG.onError = appletError;
break;
case 2:
if (window.console) console.log("case 2");
alert("Applet is already loaded");
break;
case 3:
if (window.console) console.log("case 3");
throw new Error("Error activating Applet");
break;
default:
throw new Error("Invalid Applet status");
}
Needles to say, Windows/Safari is a dead bloody loss :-( Also note that, for
FireFox and Opera, if you do an "alert('some-debug-stuff')" from you
"onError" handler the our browser freezes.
Cheers Richard Maher