Hello.
I'm trying to make a javascript that detects if user has Java, on then is he does show one div, e.g. "<div id='error'>" of "<div id='good'>" if he does have Java installed.
Here is the script:
I'm trying to make a javascript that detects if user has Java, on then is he does show one div, e.g. "<div id='error'>" of "<div id='good'>" if he does have Java installed.
Here is the script:
Code:
<html>
<head>
<script type="text/javascript">
var test = "Is Java enabled? " + navigator.javaEnabled();
var result = test.replace("Is Java enabled? ", "");
if (result == "false") {document.getElementById("error").style.display = "";}
if (result == "true") {document.getElementById("good").style.display = "";}
</script>
</head>
<body>
<div id="error" style="display:none;">
<p>Java is NOT installed.</p>
</div>
<div id="good" style="display:none;">
<p>Java is installed.</p>
</div>
</body>
</html>
Comment