Home  >  Article  >  Web Front-end  >  javascript检查浏览器是否已经启用XX功能_javascript技巧

javascript检查浏览器是否已经启用XX功能_javascript技巧

WBOY
WBOYOriginal
2016-05-16 15:50:431389browse

检测浏览器是否支持cookie功能

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

检查浏览器是否已经启用Java支持功能

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

当前浏览器的信息

<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>

以上所述就是本文的全部内容了,希望大家能够喜欢。

Statement:
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