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.java Enabled()) {
...
}
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.java Enabled() && typeof java != 'undefined') {
alert(java.lang .System.getProp erty('java.vers ion'));
}
As long as browsers are using the Sun Java plugin you can also look into
the navigator.mimeT ypes e.g.
var mimeType = navigator.mimeT ypes ?
navigator.mimeT ypes['application/x-java-applet'] : null;
if (mimeType) {
var plugin = mimeType.enable dPlugin;
if (plugin) {
alert(plugin.de scription);
}
}
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.mimeT ypes for such stuff.
--
Martin Honnen
http://JavaScript.FAQTs.com/