Can anyone tell me if the navigator.javaEnabled() is only an IE property or what? I have a code that uses that to see if java is enabled, changes it from true or false, to enabled or disabled, and then displays the result. It's saying that my java is disabled in NS even though I checked and it's not, maybe it's just my code, but can someone let me know, cause it's driving me nuts! :)
Here is my code:
var jend=navigator.javaEnabled()
if (jend==true){
document.write('<font face="verdana" style="font-size:10pt; color:000000"><b>Javascript is: </b><font color="#00CC00"><b>Enabled</b></font>.</font><br>')
}
else if (jend==false){
document.write('<font face="verdana" style="font-size:10pt; color:000000"><b>Javascript is: </b><font color="#FF0000"><b>Disabled</b></font>. [JavaScript should be <b>enabled</b> to best view this site.]</font><br>')
}
else if(jend!=true&&jend!=false){
document.write('<font face="verdana" style="font-size:10pt; color:000000"><b>Javascript is: </b><font color="#FF0000"><b>Undetermined</b></font>.</font><br>')
}
boxxer03
11-23-2005, 09:54 PM
you can see the code in action here: http://savepitbulls.8m.com/opti.html
_Aerospace_Eng_
11-23-2005, 10:04 PM
The function does work only its detecting if Java is enabled NOT javascript. Java and JavaScript are two different languages.
boxxer03
11-23-2005, 10:07 PM
LoL, i'm an idiot. I know that there different, but my brain just crapped out. LoL thanks though ;)
_Aerospace_Eng_
11-23-2005, 10:11 PM
LoL, i'm an idiot. I know that there different, but my brain just crapped out. LoL thanks though ;)
It happens, just think about it, how would it detect if JS is enabled or disabled? If it was disabled then the script wouldn't even run.
boxxer03
11-23-2005, 10:23 PM
LoL, that's the bad thing, cause I put a little warning kind of thing in there, that said if nothing shows up below then JavaScript is disabled.
kansel
11-23-2005, 10:38 PM
<script type="text/javascript">
document.write("JavaScript is enabled");
</script>
<noscript>JavaScript is disabled</noscript>
The message inside the <noscript> tag will only show up when JavaScript is turned off.