<pre lang="Javascript">function CheckFlashPlayer() { var hasFlash = false; if (navigator.plugins && navigator.plugins.length) //This part is used in Mozilla and Chrome { var plugin = navigator.plugins['Shockwave Flash']; if (plugin) { hasFlash = true; } if (navigator.plugins['Shockwave Flash 2.0']) { hasFlash = true; flashVersion = '2.0.0.11'; } } else if (navigator.mimeTypes && navigator.mimeTypes.length) { var mimeType = navigator.mimeTypes['application/x-shockwave-flash']; hasFlash = mimeType && mimeType.enabledPlugin; } else { try { // This Part is for IE var ax = new ActiveXObject('ShockwaveFlash.ShockwaveFlash.7'); hasFlash = true; } catch (e) { // Try 6 next, some versions are known to crash with GetVariable calls try { var ax = new ActiveXObject('ShockwaveFlash.ShockwaveFlash.6'); hasFlash = true; } catch (e) { try { // For checking default activeX, if all above check fails var ax = new ActiveXObject('ShockwaveFlash.ShockwaveFlash'); hasFlash = true; } catch (e) { hasFlash = false; } }}} if(hasFlash)//This part is to set visibility of demo div {document.getElementById("divWinFlash").style.display="block"; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)