js/jre

This solution works for me: http://stackoverflow.com/questions/10146836/use-deployjava-js-to-check-for-automatically-install-latest-jre-version-for-web.

Using deployJava.versionCheck() I can catch out of date or missing Java and redirect the browser to the Java download page. Not as smooth as having it download in a popup but the 1 second browser refresh is horrible and users would complain.

<script type="text/javascript" src="https://www.java.com/js/deployJava.js"></script>
<script type="text/javascript">
if (deployJava.versionCheck("1.6.0_31+") == false) { 
userInput = confirm(
"You need the latest Java(TM) Runtime Environment. " +
"Would you like to update now?"); 
if (userInput == true) { 
window.location = "http://java.com/";
}
}
else
{
var attributes = {id:"applet", name:"TheApplet", code:"TheApplet"}; 
var parameters = {jnlp_href: "http://localhost/TheApplet.jnlp"};
deployJava.runApplet(attributes, parameters, "1.6.0_31");
}
</script>

你可能感兴趣的:(js/jre)