开发者

deployJava script fails in Chrome browser

I am trying to use the deployJava script from Oracle to check the installed java version. It works fine on FireFox but fails in Chrome, as when i test java version 1.6 it always returns false which means i have a java version below 1.6, which is not right. I've seen some forums mentioning this problem, but i have found no fix for this until now.

Anyone has checked this script before ?

---------------------------------------------------> Edit - Add a code sample :

var isJavaValid = deployJava.versionCheck( '1.6.0+' );

if( isJavaValid == false ) {
   alert( "Java required version is not found" );  // Always appears.
}
else {
   alert( "You have the right java v开发者_如何学运维ersion." );
}


This works for me:

<html>
<head>
<script type="text/javascript" src="http://java.com/js/deployJava.js"></script>
<script type="text/javascript">
function init()
{
var isJavaValid = deployJava.versionCheck( "1.6.0+" );

if( isJavaValid == false ) {
   alert( "Java required version is not found" );  // Always appears.
}
else {
   alert( "You have the right java version." );
}
}
</script>
</head>
<body onload="init()">
</body>
</html>

Test here: http://jsbin.com/ikiza4

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜