Check Java Enable on browser or not : In some web application we need to run Java applets, flash and other softwares and these softwares only runs when Java is enabled on browser. So now the question is how a developer know that browser has Java enabled or disabled ? To solve this issue JavaScript provides the developer a method called javaEnabled() which can be called by the navigator object.
Syntax of javaEnabled() method :
navigator.javaEnabled()
Example to check browser has Java Enable or not : In this example I will show you how we can check that Java is enabled on the browser or not.
<!DOCTYPE html>
<html>
<body>
<p>To check your browser has Java enabled or not, click the button.</p>
<button onclick="checkJavaEnable()">Check enable java</button>
<p id="container"></p>
<script>
function checkJavaEnable() {
var isJavaEnabled = "Java Enabled: " + navigator.javaEnabled();
document.getElementById("container").innerHTML = isJavaEnabled;
}
</script>
</body>
</html>
Output :
Java Enabled: true
0 Comment(s)