Hello stackoverflow community,
I have some code that works on virtually every browser except for …. (Wait for it)…. IE9 (and possibly other versions of IE?).
So, I’ve added an applet to the page, everything goes well, but I want to check to see if the applet is loaded, so to do that, I’ve been polling to see if the functions in the applet exist.
For example, let’s say I have this method in my java applet:
public int dummy( int a ) {
return a + 1;
}
So in my javascript, I poll to see if the function exists like this (using jquery, where #applet is the id of the applet tag):
var japp = $("#applet").get(0);
if( japp && japp.dummy ) {
alert( japp.dummy(1) );
}
You’d notice that this works at least in Chrome and Firefox, but not IE9.
In IE9, regardless of the method being accessible, japp.dummy always returns undefined
Does anyone know a good IE9 workaround?
Thanks,
-Oz
Don’t do that. Instead, have the applet call a JS function at the end of
init(). The end ofinit()is when the applet is ready.Substitute IE9 with ‘any browser’ and you have the niggling problems with applet/JRE/JS/browser interaction pegged. That’s the nature of applets, unfortunately. 🙁