js检测浏览器flash支持

function hasFlashPlugin(){
	 try{
          new ActiveXObject('ShockwaveFlash.ShockwaveFlash');
          return true;
      }catch(ex){
		  for(var i=0; i<navigator.plugins.length; i++){
				if(navigator.plugins[i].name.toLowerCase().indexOf('flash') > -1){
					   return true;
				}
		  }
		  return false;
      }
}

 

posted @ 2016-04-25 15:27  天桥残局  阅读(198)  评论(0编辑  收藏  举报