I tried to load flash (swf file) either from external sources or local sources,
I use object tag in html to contain the flash for some reason, if I load the flash directly in the object tag, it will work flawlessly, like this:
<object height="100" width="100" data="helloworld.swf" id="flash"></object>
Next, I need to load the flash dynamically from JavaScript, but several problems arise:
var flash=document.getElementById("flash");
flash.setAttribute("data","helloworld.swf");
the code above works fine in Chrome, but it doesn't do anything in IE (my IE is IE11 on windows 8)
If I modify the object tag to iframe tag, then it works, but I need it to be object tag,
Any solutions come to mind?
Use SWFObject. It will save you from all the cross-browser compatibility troubles.