zoukankan      html  css  js  c++  java
  • 检测浏览器是否安装FLASH插件

        var iFlash = null;
    var version = null;
    var isIE = navigator.userAgent.toLowerCase().indexOf("msie") != -1
    if(isIE){
    //for IE

    if (window.ActiveXObject) {
    var control = null;
    try {
    control = new ActiveXObject('ShockwaveFlash.ShockwaveFlash');
    } catch (e) {
    iFlash = false;
    }
    if (control) {
    iFlash = true;
    version = control.GetVariable('$version').substring(4);
    version = version.split(',');
    version = parseFloat(version[0] + '.' + version[1]);
    alert("FLASH版本号:"+version)
    }
    }
    }else{
    //for other
    if (navigator.plugins) {
    for (var i=0; i < navigator.plugins.length; i++) {
    if (navigator.plugins[i].name.toLowerCase().indexOf("shockwave flash") >= 0) {
    iFlash = true;
    version = navigator.plugins[i].description.substring(navigator.plugins[i].description.toLowerCase().lastIndexOf("Flash ") + 6, navigator.plugins[i].description.length);
    }
    }
    }
    }
    if(iFlash){
    alert(version)
    }else{
    alert("您的浏览器未安装FLASH插件");
    }
  • 相关阅读:
    Lambda
    Thread&线程池
    异常
    Map
    List and Set
    Collection和迭代器Iterator
    Object类,常用API
    (一)自定义 mybatis 之框架介绍
    Nginx三大功能及高并发分流
    http协议改为https
  • 原文地址:https://www.cnblogs.com/SCOOL/p/2360228.html
Copyright © 2011-2022 走看看