简体   繁体   中英

detect java/jre on IE6 using javascript

I want to know if there is an alternative way to find out if JRE is installed on IE6, besides using the Java deployment toolkit (getJRE()). I tried to use navigator.javaEnabled() , but it returns true no matter if JRE is installed or not. Moreover, navigator.plugins[i].name returns undefined object on IE6.

From an applet:

System.getProperty("java.version");
System.getProperty("java.vendor");

Then you need to get that data from javascript using LiveConnect.

EDIT: I founded a post with this method in this link

This isnt a nice looking but it works for me on ie6 you could try and catch if error and then even use the var defining the java object as well to check again.

try {
var j = new java.util.Date();
}
catch(err) {
document.write('no java'); // example
}

alert(j) // undefined

there the page RIA Deployment Advice

http://download.oracle.com/javase/6/docs/technotes/guides/jweb/deployment_advice.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM