Home > Web Front-end > JS Tutorial > javascript checks whether the browser has enabled XX function_javascript skills

javascript checks whether the browser has enabled XX function_javascript skills

WBOY
Release: 2016-05-16 15:50:43
Original
1456 people have browsed it

Check whether the browser supports cookie function

<script>
if(navigator.cookieEnabled)
{
document.write("你的浏览器支持cookie功能!");
}
else{
document.write("你的浏览器不支持cookie!");
}
</script>

Copy after login

Check whether the browser has Java support enabled

<script type="text/javascript">
document.write("navigator对象的方法"+"<br>");
if(navigator.javaEnabled())
{
document.write("浏览器支持并启用了Java的方法!"); //提示用户支持Java方法
}
else
{
document.write("浏览器不支持或没有启用Java的方法!"); //提示用户不支持Java方法
}
</script>

Copy after login

Current browser information

<script type="text/javascript">
with(document)
{
write("你的浏览器信息:<ol>");
write("<li>代码:"+navigator.appCodeName);
write("<li>名称:"+navigator.appName);
write("<li>版本:"+navigator.appVersion);
write("<li>语言:"+navigator.language);
write("<li>编译平台:"+navigator.platform);
write("<li>用户表头:"+navigator.userAgent);
}
</script>
Copy after login

The above is the entire content of this article, I hope you all like it.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template