Pink Edition
In January I wrote about the coming ActiveX update that will change how embedded content will be handled in Internet Explorer. In short, things like Flash movies will have to be activated (clicked) before they can be used.
Jason Baker (ripper.rhetoric) has created a nifty piece of JavaScript that solves the problem nicely. All you need to do is to add his code to your site and everything works like it used to.
The script is very simply. All it does it that it removes the entire block of embedded content, and reinserts it using innerHTML. Voila!
Jason writes: "Now, while it seems that this is just a quick fix for the lazy, it does have some real applications that couldn't be done otherwise, like ColdFusion-generated Flash Forms."
Actually, I think this beats Microsoft solution. It prevents us from making browser specific code for embedding things like flash and it allows us to focus on the content instead of some technical external JavaScript call.
He has even offered two version of the script - a header version for the HTML purists and a version that can be attached to the end of the HTML page.
Note: This also solves the bug in IE, where HTML content placed above embedded content would be made inactive too.
Thomas Baekdal - Nov. 15, 2006
Simon, Is it legal? Yes. Ethical? No.
But, when I look at the two examples on their page, the code they use are far from the same:
objects = document.getElementsByTagName("object");
for (var i = 0; i < objects.length; i++) {
objects[i].outerHTML = objects[i].outerHTML;
}
BTW: This code can be found on many websites in the world - including Microsoft's. It is far from revolutionary.
Anyway, I would not pay $99 for something like this. For only $49 I can get a fully featured website PDF creator, or an insane amount of much more complex systems. $99 for 4 lines of code is insane.
Thomas Baekdal - Nov. 15, 2006
For instance, here is another "free" example from ActionOnline
theObjects = document.getElementsByTagName('OBJECT');
for (var i = 0; i < theObjects.length; i++) {
theObjects[i].outerHTML = theObjects[i].outerHTML;
}
look familiar?
...or this one from mix-fx
theObjects = document.getElementsByTagName("object");
for (var i = 0; i < theObjects.length; i++) {
theObjects[i].outerHTML = theObjects[i].outerHTML;
}
The only thing they have done is to change "theObjects" to "Objects" (which coincidently is bad coding practice too).
sayd habib - May. 31, 2008
please send me internet explorer7 active x update
Published: Apr. 3, 2006 in Technology

Thomas Baekdal is a Writer, Interaction Designer, Change Advocate and Project Manager.
simon murray - Nov. 15, 2006
Hi
about this javascript workaround to prevent the 'click to activate this control' text, I've seen a company selling a product for £99 http://www.bluenewt.info which is just in effect this javascript solution, in fact its down to just 3 lines of code. Would this be legal?