How to check JRE version of client machine with Javascript

.


The example below checks if a user has JRE version 1.6.0_13 or greater installed. If not, it installs the latest JRE.


<script src="http://java.com/js/deployJava.js"></script>
<script>

// check if current JRE version is greater than 1.6.0
alert("versioncheck " + deployJava.versionCheck('1.6.0_10+'));
if (deployJava.versionCheck('1.6.0_10+') == false) {
userInput = confirm("You need the latest Java(TM) Runtime Environment. Would you like to update now?");
if (userInput == true) {

// Set deployJava.returnPage to make sure user comes back to
// your web site after installing the JRE
deployJava.returnPage = location.href;

// install latest JRE or redirect user to another page to get JRE from.
deployJava.installLatestJRE();
}
}
</script>




0 comments:

:)) ;)) ;;) :D ;) :p :(( :) :( :X =(( :-o :-/ :-* :| 8-} :)] ~x( :-t b-( :-L x( =))

Post a Comment