javascript checks whether the browser has XX enabled

  • 2020-07-21 06:57:33
  • OfStack

Checks whether the browser supports cookie


<script>
if(navigator.cookieEnabled)
{
document.write(" Your browser supports it cookie Features! ");
}
else{
document.write(" Your browser does not support it cookie!");
}
</script>

Check that the browser has Java support enabled


<script type="text/javascript">
document.write("navigator Method of an object "+"<br>");
if(navigator.javaEnabled())
{
document.write(" Browser support and enabled Java The way! "); // Prompt user support Java methods 
}
else
{
document.write(" The browser is not supported or enabled Java The way! "); // Prompt the user not to support it Java methods 
}
</script>

Information about the current browser


<script type="text/javascript">
with(document)
{
write(" Your browser information: <ol>");
write("<li> code :"+navigator.appCodeName);
write("<li> Name: "+navigator.appName);
write("<li> Version: "+navigator.appVersion);
write("<li> Language: "+navigator.language);
write("<li> Compilation platform: "+navigator.platform);
write("<li> User header: "+navigator.userAgent);
}
</script>

This is the end of this article, I hope you enjoy it.


Related articles: