通过JS来获取客户端Flash版本

可以用下面一个来自google的函数,

function _uFlash() {
var f = "-", n = navigator;
if (n.plugins && n.plugins.length) {
    for (var ii = 0; ii < n.plugins.length; ii++) {
          if (n.plugins[ii].name.indexOf('Shockwave Flash') != -1) {
              f = n.plugins[ii].description.split('Shockwave Flash ')[1];
              break;
         }
    }
} else if (window.ActiveXObject) {
     for (var ii = 10; ii >= 2; ii--) {
        try {
           var fl = eval("new ActiveXObject('ShockwaveFlash.ShockwaveFlash." + ii + "');");
           if (fl) {
               f = ii + '.0';
              break;
           }
        } catch (e) {
       }
   }
}
return f;
}

//alert(_uFlash());

来源:http://www.doself.com/showlog-21.html

posted @ 2009-02-03 18:10  悟〈--觉  阅读(735)  评论(0编辑  收藏  举报