cnundefined

由于IE和非IE浏览器检测方式不同,所以代码如下


function
hasPlugin(name){ debugger; name = name.toLowerCase(); for(var i=0; i < navigator.plugins.length; i++){ if(navigator.plugins[i].name.toLowerCase().indexOf(name) > -1){ return true; } } return false; }
// IE
function hasIEPlugin(name){ debugger; try{ new ActiveXObject(name); return true; } catch (ex){ return false; } } function hasFlash(){ debugger; var result = hasPlugin("Flash") if(!result){ result = hasIEPlugin("ShockwaveFlash.ShockwaveFlash"); } return result; } console.log(hasFlash());

 

分类:

技术点:

相关文章:

  • 2021-11-04
  • 2021-11-07
  • 2021-11-19
  • 2021-11-07
  • 2021-12-27
  • 2021-12-27
  • 2021-11-07
  • 2021-11-19
猜你喜欢
  • 2021-11-28
  • 2021-11-08
  • 2021-11-07
  • 2021-11-17
  • 2022-01-10
  • 2021-11-17
  • 2021-11-19
相关资源
相似解决方案