//偵測非IE瀏覽器外掛程式
function hasPlugin( name) {
name = name.toLowerCase();
for (var i=0 ; i if (navigator.plugins[i].name.toLowerCase ().indexOf(name) >-1) {
return true;
}
}
return false;
}
///IE瀏覽器外掛函數
function hasIEPlugin(name) {
try {
new ActiveXObject(name);
return true;
}
catch (ex) {
return falsese ; }
}
//偵測所有瀏覽器中的Flash
function hasFlash() {
var result = hasPlugin("Flash");
if (!result) {
result = hasIEPlugin("ShockwaveFlash.ShockwaveFlash");
}
return result;
}
//偵測所有瀏覽器中的QuickTime
function hasQuickTime(varrespult = hasPlugin("QuickTime");
if (!result) {
result = hasIEPlugin("QuickTime.QuickTime");
}
return result;
}
alert(hasFlash());
alert(hasQuickTime());