javascript检查插件是否已经在IE和firefox上安装

转载:http://www.w3dev.cn/article/20120918/javascript-check-plugin-installed-in-IE-firefox.aspx
显示您浏览器的useragent和navigator.useragent,以及渲染模式  http://www.myie9.com/useragent/


一、IE检查插件是否安装,通过创建ActiveXObject来实现,提示“ActiveX控件和本页其他部分的交互...”警告这个也说明安装过插件了,但是点击否不会继续new ActiveXObject后的语句

-收缩 HTML代码   运行代码   [如果运行无效果,请自行将源代码保存为html文件运行]
<script>
try{ //
         var varTest =  new ActiveXObject( "jmail.Message");
        alert( "jmail.Message已经在系统上安装过!")
 } catch (e) {
       alert( "没有可支持的插件!");
}
</script>

ActiveX控件和本页其他部分的交互

二、FF检查插件是否安装,通过创建navigator.plugins来实现,下面源代码输出所有安装的插件

-收缩 HTML代码   运行代码   [如果运行无效果,请自行将源代码保存为html文件运行]
<script>
document.writeln( "<table border=1><tr valign=top>",
    "<th align=left>i",
    "<th align=left>名称",
    "<th align=left>文件名",
    "<th align=left>描述",
    "<th align=left>类型数</TR>")
for (i=0; i < navigator.plugins.length; i++) {
   document.writeln( "<tr valign=top><td>",i,
       "<td>",navigator.plugins[i].name,
       "<td>",navigator.plugins[i].filename,
       "<td>",navigator.plugins[i].description,
       "<td>",navigator.plugins[i].length,
       "</tr>")
}
document.writeln( "</table>");
</script>
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值