Hi,
I have an ASP.NET page which loads a Java Applet. I am first checking that the client computer has the ability to run the applet (Java version etc) by giving the tag an ID of "AppletID" - then I call a function of this applet which always returns "true".
So, the following line of code: var isRunning = document.getElementById('AppletID').appletRunning() will return "true" if the method "appletRunning" in the applet is called successfully (indicating that the client can load the applet correctly).
This was always working until recently. However, lately, Firefox browsers give me an intermettent dialog box showing the "You do not have the required minimum version of Java..." message. (Other times it correctly detects that the applet can be loaded). The applet then proceeds to load correctly, but the dialog should not be shown in the first place. I wonder why this is happening - it possibly could be that document.getElementById('AppletID') is being null when it is checked, thus leading to the "catch" part of the "checkAppletRunning" method? IE is always OK and never returns this dialog box.
Below is the code of the .aspx page.
<script type="text/javascript" language="javascript">
window.onload = function()
{
var appletCheck = checkAppletRunning();
if (appletCheck == 1)
{
alert("Server is down...please try again later.");
window.location.href = "Default.htm";
}
else if (appletCheck == 2)
{
alert("You do not have the required minimum version of Java enabled or installed. Java must be enabled or downloaded from http://www.java.com");
window.location.href = "Default.htm";
}
}
function checkAppletRunning()
{
var OK = 0;
var serverDown = 1;
var appletNotSupported = 2;
try
{
var isRunning = document.getElementById('AppletID').appletRunning();
if (isRunning)
{
return OK;
}
else
{
return appletNotSupported;
}
}
catch (e)
{
return appletNotSupported;
}
}
</script>
I would appreciate any help in this matter,
Thanks in advance, Timothy