Everyone must have seen it. Anything to do with flash, windows movies, al, on the internet, you have to click to use them first, to deactivate that random box.
The thing is, i'm going to be using flash on my site, so how do i get rid of this problem, and i know it can be done, as i have found many sites on this, but they seem to be either too confusing or don't work.
function reActiveX()
{
// Test user agent
var strAgent = navigator.userAgent.toUpperCase();
var nIEIdx = strAgent.indexOf("MSIE");
if (nIEIdx == -1)
{
// If user agent does not look like IE, return -- this is not needed.
return;
}
// Build arrays of elements to rewrite
var doaEmbeds = document.getElementsByTagName("embed");
var doaObjects = document.getElementsByTagName("object");
var doaApplets = document.getElementsByTagName("applet");
// Iterate through objects, rewriting as we go
// EMBED
for (var raxi = 0; raxi < doaEmbeds.length; raxi++ )
{
var doRewriteObj = doaDomObjsToRewrite[raxi];
var doParentObj = doRewriteObj.parentNode;
var strHTML = doParentObj.innerHTML;
doParentObj.removeChild(doRewriteObj);
doParentObj.innerHTML = strHTML;
}
// OBJECT
for (var raxj = 0; raxj < doaObjects.length; raxj++ )
{
var doRewriteObj = doaObjects[raxj];
var doParentObj = doRewriteObj.parentNode;
var strHTML = doParentObj.innerHTML;
doParentObj.removeChild(doRewriteObj);
doParentObj.innerHTML = strHTML;
}
// APPLET
for (var raxk = 0; raxk < doaApplets.length; raxk++ )
{
var doRewriteObj = doaApplets[raxk];
var doParentObj = doRewriteObj.parentNode;
Now save that as reactivex.js (save as type: all files)
then put that file in your website folder and add this little bit of cose to the end of the html in every page:
Whenever you come along with a question that is a variation on "how do I cut out a browsers security/whatever features for my own convinience", you're not going to come across a great awnser.
Now then, a plain old flash object isn't going to bring up MSIEs warning. It's going to be the way that it interacts with other scripting on the page or the action script that the flash file uses.
Disclaimer. (1) Whilst I will help you sometimes, if I feel like it, and my advice in relation to your actual question will be of good quality: my posts are to be taken with a pinch of salt. I will be sarcastic, deploy irony and include obscure cultural references for my own amusement without warning.
(2) You will gain nothing from complaining, and if you try to argue with me then you will not win. No matter how noble your battle seems, I am still better than you, don't be an hero.
The method I showed activates the flash automatically so that the box doesnt appear around it. You can see it working with the flash insert on my website: www.hertfordshire-web-design.co.uk
And if you view the source for that page you will see the code I mentioned just before the </html> right at the end, make sure you have put it in the same place on your pages. Give it another go as you can see it works there.
Hi - I found your solution to ActiveX problems and have tried to implement your solution in my code. However, I receive the error "object expected" on the line "reActiveX();" that's added to the html document. What I am doing wrong? I copied your code verbatim. Thanks,
Note that Internet Explorer is not the only browser that requires such activation. The court ruling in favour of Eolas require that all browsers should require such activation for all embedded objects although Eolas gave Firefox an exemption due to its being open source. All other browsers such as Netscape, Opera, Safari, etc will therefore have the same activation issue (if not with the current version then with the next version once they fall into line with the court ruling).
Hi! I tried your code in my website, and it worked perfectly in IE and Firefox, but the website won't open in Netscape with the js. script that gets rid of the Active x control. It previously worked in the Netscape, too.
The method I showed activates the flash automatically so that the box doesnt appear around it. You can see it working with the flash insert on my website: www.hertfordshire-web-design.co.uk
And if you view the source for that page you will see the code I mentioned just before the </html> right at the end, make sure you have put it in the same place on your pages. Give it another go as you can see it works there.
Bookmarks