JS 判断浏览器是否安装Flash 兼容IE、firefox
时间:2014-11-14 19:41:28
收藏:0
阅读:410
var isIE = !-[1,];
if(isIE){
try{
var swf1 = new ActiveXObject(‘ShockwaveFlash.ShockwaveFlash‘);
alert(‘安装了Flash‘);
}
catch(e){
alert(‘没有安装Flash‘);
}
}
else {
try{
var swf2 = navigator.plugins[‘Shockwave Flash‘];
if(swf2 == undefined){
alert(‘没有安装Flash‘);
}
else {
alert(‘安装了Flash‘);
}
}
catch(e){
alert(‘没有安装Flash‘);
}
}
其他参考地址:https://github.com/AlloyTeam/JM/blob/master/src/jm.browser.js
原文:http://www.cnblogs.com/vivijs/p/4097900.html
评论(0)