-2
我正在使用jquery 1.9。使用这个jQuery版本,我们如何检查Flash在运行浏览器中是否启用?如何检查Flash是否在浏览器中启用?
我正在使用jquery 1.9。使用这个jQuery版本,我们如何检查Flash在运行浏览器中是否启用?如何检查Flash是否在浏览器中启用?
试试这个:
var hasFlash = false;
try {
var fo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash');
if(fo) hasFlash = true;
}catch(e){
if(navigator.mimeTypes ["application/x-shockwave-flash"] != undefined)
hasFlash = true;
}
OR
jqplugin:http://code.google.com/p/jqplugin/
$.browser.flash == true
这似乎对我来说(足够好)。当它上市时,我们将转向Modernizer v3。 – genexp 2014-09-09 17:30:44
您正在寻找Modernizr的,不是jQuery的。 http://stackoverflow.com/questions/9038034/test-whether-a-device-has-flash-enabled-modernizr-style – ahren 2013-03-15 06:31:34
Flash还没有一个可靠的Modernizr检测 - 但我们想要一个!见https://github.com/Modernizr/Modernizr/issues/48 – 2013-03-15 16:43:59