Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #14015
| From | "Richard Maher" <maher_rj@hotspamnotmail.com> |
|---|---|
| Newsgroups | comp.lang.java.programmer, comp.lang.javascript |
| Subject | Re: Java7 Applet Status and Event Handlers |
| Date | 2012-04-29 18:01 +0800 |
| Organization | HTTP *is* The Box - Let's think outside |
| Message-ID | <jnj3ij$idv$1@speranza.aioe.org> (permalink) |
| References | <jnbfsm$10q$1@speranza.aioe.org> <jnfrl8$o1d$1@speranza.aioe.org> |
Cross-posted to 2 groups.
"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
>
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Find similar | Unroll thread
Java7 Applet Status and Event Handlers "Richard Maher" <maher_rj@hotspamnotmail.com> - 2012-04-26 20:42 +0800
Re: Java7 Applet Status and Event Handlers "Richard Maher" <maher_rj@hotspamnotmail.com> - 2012-04-28 12:28 +0800
Re: Java7 Applet Status and Event Handlers "Richard Maher" <maher_rj@hotspamnotmail.com> - 2012-04-29 18:01 +0800
csiph-web