If I run this code on IE8 or lower, I get this error: Object doesn't support this property or method
var hasFlash = ((typeof navigator.plugins != "undefined" && typeof navigator.plugins["Shockwave Flash"] == "object") || (window.ActiveXObject && (new ActiveXObject("ShockwaveFlash.ShockwaveFlash")) != false));
Maybe the
new ActiveXObjectpart is failing, becauseActiveXObjectis (in your current setup) not anything that thenewoperator can be applied to — or ‘ShockwaveFlash.ShockwaveFlash’ isn’t a valid input and therefore an exception is thrown.You can however easily rewrite your code to address that problem: