首页 > 编程 > JavaScript > 正文

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

2019-11-20 12:04:14
字体:
来源:转载
供稿:网友

检测浏览器是否支持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>

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

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表