jpick
asked on
Detecting Java support on XP (and in IE )
Our product uses Java and we are trying to detect if a java plugin has been installed on a client's machine. When using XP, Clients are propted to download java when a web page tries to load an applet. I'm wondering if there is a way to detect if the browser can run an applet before this dialog presents itself?
The solution must be some client-side script that can detect both Sun's JVM and MSJVM. I am aware of the XML interface to IE that allows you to check for MSJVM (although I have not tested it yet). What I'm really looking to do is find out what the user has so our application can download the appropriate tools for them.
Any help is appreciated.
-Jeff
The solution must be some client-side script that can detect both Sun's JVM and MSJVM. I am aware of the XML interface to IE that allows you to check for MSJVM (although I have not tested it yet). What I'm really looking to do is find out what the user has so our application can download the appropriate tools for them.
Any help is appreciated.
-Jeff
ASKER
Thanks for the code, I'm dealing with another crisis today, hopefully I'll be able to check out the code this evening.
anything?
any luck? did it solve your problem???
Still waiting for an answer
ASKER
Well, sorry it took me so long to get back to you. The short answer is I don't know since I lost my job last week. Since I don't have access to the XP box anymore I won't be able to give you an answer.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
thank you ... :))
And again, good luck.
And again, good luck.
The following code seems to work on a mac (ie5) as well as pc (ie, netscape6+, opera 5+):-
<script language="javascript" type="text/javascript">
<!--
var i_java;
var v_java;
// -->
</script>
<script language="vbscript">
<!--
on error resume next
i_java = IsObject(CreateObject("Jav
// -->
</script>
<script language="javascript" type="text/javascript">
<!--
if (navigator.mimeTypes && navigator.mimeTypes.length
if (typeof(navigator.mimeType
i_java = true;
if (navigator.plugins) {
for (var i=0; i < navigator.plugins.length; i++) {
if (navigator.plugins[i].name
i_java = true;
v_java = navigator.plugins[i].descr
break;
}
}
}
// -->
</script>
Java enabled -
<script language="javascript" type="text/javascript"><!-
(navigator.javaEnabled()) ? document.writeln("Java is enabled!") : document.writeln("Java is NOT enabled!");
// --></script>
Java supported -
<script language="javascript" type="text/javascript"><!-
if (i_java || navigator.javaEnabled()) {
document.writeln("Yes");
if (v_java) {
document.writeln(" - version " + v_java);
}
} else {
document.writeln("No or unable to detect...");
}
// --></script>