Dani Shapira wrote:
Dani Shapira wrote:
can anyone help me with how to find if JAVA is evalible and if yes,
of what version?
The quetion is: How can I, in JavaScript, find out if Java is avaliable
for this browser to run applet og later page.
Most browsers should support
if (navigator.javaEnabled()) {
...
}
Testing the Java version is probably better done then in a Java applet
itself, only a few browsers (Mozilla, Opera) support LiveConnect
JavaScript->Java direct access e.g.
if (navigator.javaEnabled() && typeof java != 'undefined') {
alert(java.lang.System.getProperty('java.version') );
}
As long as browsers are using the Sun Java plugin you can also look into
the navigator.mimeTypes e.g.
var mimeType = navigator.mimeTypes ?
navigator.mimeTypes['application/x-java-applet'] : null;
if (mimeType) {
var plugin = mimeType.enabledPlugin;
if (plugin) {
alert(plugin.description);
}
}
for me here on Windows that shows
Java Plug-in 1.5.0_01 for Netscape Navigator (DLL Helper)
so you could try to extract the version from that string.
But IE/Win doesn't support navigator.mimeTypes for such stuff.
--
Martin Honnen
http://JavaScript.FAQTs.com/