I have a function that if called, includes a js file and uses an object from the js file. The problem is in IE9. IE9 gives me an error of 'swfobject' is undefined. All other browsers work fine. The functions are:
function checkFlash(ver,cond){
includeJS(context+'/scripts/swfobject.js', function () {
var playerVersion = swfobject.getFlashPlayerVersion().major;
if (playerVersion < ver) {
cond();
}
});
}
function includeJS(p_file, callback) {
var v_js = document.createElement('script');
v_js.type = 'text/javascript';
v_js.src = p_file;
v_js.onreadystatechange = callback;
v_js.onload = callback;
document.getElementsByTagName('head')[0].appendChild(v_js);
}
Any way to get around that error? Btw, you can see this thread for more information about the functions.
I am quite confident it is not the swfobject.js file as it works fine otherwise, but in any case, here is the file.