Fixing the IE EMBED, OBJECT and APPLET Problem: Dynamic Embedding with JavaScript
The IE Nightmare A Reality
First you should read this quote from microsoft.com about Internet Explorer:
“…Internet Explorer 6 includes many new and enhanced features that can simplify the daily tasks that you perform…Internet Explorer 6 gives you the freedom to experience the best of the Internet…”
I can’t believe they would claim this.
What Is The Problem
Microsoft has decided to break every web-page that is using an EMBED, OBJECT or APPLET tag by forcing the user to click each time the page is loaded to “allow activation” of the content. That means that any user with the latest build of IE will be required to activate the navigation each time the load a page that contains that navigation. Might not seem like a big deal until you actually have to click EVERY page of a website to get it to do what it used to do perfectly.
What Is The Solution
The remainder of this article will explain how to get around this BUG (yes – I will continue to call this a bug even though they are doing it intentionally) in Internet Explorer. I’m going to detail two solutions, the first of which I believe to be the best answer for all.
Solution 1: Start using Firefox.
This sounds simple I know, but the reality of the matter is this: Firefox is better in every way than Internet Explorer. It’s free, it’s fast, it’s been two or three steps ahead of IE for the past few years, and you will not regret installing it. Likewise, you will not regret uninstalling Internet Explorer (although I’m sure Microsoft makes it virtually impossible to uninstall IE).
Unfortunately, we’d all have to start using it, and we’d all have to get all of our customers to start using it… So, while this does seem to solve the problem, it is a bit unrealistic.
Solution 2: Dynamic JavaScript Embedding
I know that sounds complicated, but believe it it’s not. Here’s the HTML for a simple website that used to work great (until Microsoft went and changed the rules on everyone):
[Example 1] (just “view source”)
This is the default output when you publish from the Flash development application, so there’s a good chance your Flash movies are embedded like this. Here’s a quick way to fix the problem:
[Example 2] (again, “view source”)
So what did we do? In English, we simply created a JavaScript function in the header section of our web-page that writes the html embed and object tags at the time the page is loaded. Then we call that function in the body section. This allows us to bypass the Internet Explorer bug.
Now, keep in mind that this is a very simplistic solution. It’s designed to give you an idea on the direction to head. While this code will work in most cases, know that it does require JavaScript to be enabled on the user’s browser. Another problem with this solution is that you have to put this function in every file with Flash embedded, and you have to create it specifically for each Flash movie (it’s not very modularized). We could go through the explanation of how to link to an external JavaScript file and how to pass parameters to JavaScript functions, but that is beyond the scope of this article and there are plenty of examples out there that explain these things.
I do want to point you to a free tool put out by the team at deconcept.com. It’s called “FlashObject” and it allows you to dynamically embed Flash movies in your html. It also provides a lot of other very nice features. It’s quite slick, read about it and download it here:
In Conclusion
I just want to say that I think Microsoft is really shooting themselves in the foot with this move. All the website developers out there can’t stand Internet Explorer because of it’s flakey interpretation of the W3C standards. Everything is more complicated for us because of the way that Internet Explorer works. I would really ask that you consider using Firefox. You won’t regret it!
Related posts:
- Useful JavaScript code snippet to save your website content from being copy-pasted!
- Best 404 Page
- Opera 10.5 brings new JavaScript engine
- Firefox and the Retarded Browsers(Video)
- “Ads by Google” Label to Undergo a Dynamic Change
Filed Under: Internet

Microsoft didn’t “decide” this – it was a lawsuit they lost based on a Eolas patent.
That method does not work. Did you not even try it yourself before yiou published?. The JavaScript needs to be external. You cannot define it in the same page as the HTML is you want to bypass the ‘click-to-activate’.
Firefox is not better in every way at all. It simply has different sets of problems. Anyone who has been working with Flash etc will know that there is NO best browser. However, there is a most popular and commonly used browser .. and that is still Internet Explorer. Others may have a feature here or a feature there that is better, but regardless, Internet Explorer is still the one most people use. For this reason, sites are more often than not written, tested on and optimsed for working with IE.
The change Microsoft has been forced to make to IE (no .. its not a feature, but its not a bug either) is going to make life difficult for all concerned. I don’t think there is anyone (least of all at Microsoft) who like the idea .. but we’re stuck with it.
There are a number of solutions, many not as radical as ‘FlashObject’ (which required rewriting of your web pages and removal or the old object/embed tags. There are other solutions appearing that simply require the addition of some additional script tags and no other change to existing HTML.
I tried your example and it doesn’t seem to work on IE 6.0.2900.2180.xpsp_sp2_gdr.050301-1519.
I wanted to vent some frustrations to you. I have used Dreamweaver since version 2. Now, almost every site that I do has an application in it. I love Flash and use it on almost every site we design. I’ve been using it professionally since 2000. I also develop in ColdFusion and I try to push this as the solution for clients.
I feel that DW should have made some changes to their program to make it more friendly to serious developers. Instead, they hastily released version 8 with so many bugs that I can’t use it with my team – it won’t FTP correctly if multiple files are selected for upload, the times are screwed up, template issues, even simple find and replace features seem to have been “sabatoged”. I waited for the update, but I consider the $400 I spent on the upgrade an investment in the Flash 8 program because I can’t even use DW 8. Where am I going with this?
So Macromedia was on the downslide before they were bought out by Adobe. They were trying to acquire all kinds of software companies in a hit and miss fashion, leading developers down paths that weren’t going anywhere in some cases. And then they were getting greedy with the licensing set ups on the servers, just like the company that everyone loves to hate. Then Adobe buys them out. I haven’t seen much out of this company that makes me want to support them. All I’ve seen is a lot of pride and a remarkable increase in the cost of DW and Flash, and DW doesn’t seem to be going anywhere, so that only leaves Flash, which if it doesn’t work properly in a browser that is used by 90 something percent of the public, then what good is it going to be?
I was loyal to Macromedia for 6 years. I don’t feel the same loyalty towards Adobe, especially after the DW8 upgrade. I have had to develop in .NET for a few clients, which has shown me that Microsoft has somehow taken incredible steps in the way that applications are developed for web sites. The more that I use Visual Studio (and it’s free), the less that I want to use Dreamweaver and work around everything that DW doesn’t do correctly). It seems that the guys I used to hate so much are actually working overnight to obtain my loyalty, and it’s hard not to like them when it comes to application development. I’m in a sad place. I feel like it was bad timing on Adobe’s part and Microsoft is making some good moves to capitalize on that.
I must apologize regarding my failed example! I was too hasty in publishing. Meant to explain that it needs to be external, but wanted to show the code. I should have just included in in the article.
Regardless, it is external now.
I also must say that I’m an Apple guy – so I certainly have a natural dislike of Microsoft. I do respect all of your opionions about MS and their decision. I’m just tired of them throwing their weight around.
I also must say that FireFox is much more standards compliant.
Regarding the DreamWeaver comments above – I’ve actually been very frustrated with their FTP problems. So much so that I’m using GoLive to handle that portion of my sites. The rest I still code by hand…
Thanks for your comments all,
Ben
Just one more comment:
Those of you defending Microsoft might consider that a company like MS doesn’t get sued and not win unless they really are doing something that is not right. Maybe they shouldn’t have violated the patent in the first place.
And just because IE is installed on every PC by default doesn’t make it the best browser out there. I’m not saying that FireFox is perfect, only that they actually pay attention to the standards which makes life easier for everyone. If MS would do this (instead of trying to create their own standards) I’d have no problem using their browser.
Ben
One more…
Here is the best article I’ve been able to track down so far. Good explanations here:
Macromedia Explanation
Thanks all,
Ben
Ben,
I understand your loyalty coming from a Mac user position. I’m writing to you through my trusty Netscape 7.2 browser. I used to use Netscape exclusively, then used IE for about 3 years, now I’m back to Netscape due to security issues. I don’t think that Netscape renders CSS as well as IE, though.
From a real world perspective, if you’re making money in web design/applictions, and over 96% of the population uses PC’s and not Macs, and about 99.9% of businesses use Microsoft (out of currently 20 clients, I can’t think of any that don’t use Microsoft exclusively) IE and associated Microsoft products such as Outlook, Excel and Word, then what are you going to do? And is Adobe truly loyal to you?
This is real world stuff here.
Also, Thanks Ben for all the work that you’ve put forth in trying to help people like me solve the riddle.
Mac… duh! Microsoft rocks like the rock of Gibraltar…
Hi
As I said in my earlier comment, IE is not a perfect browser .. no browser is. One may spout the benefits of Firefox and how it is more standard compliant .. but that is all completely irrelevant when it comes to designing your web site. As much as you may prefer it yourself, you cannot force your visitors to use a moniorty browser just so you can make your html comply to web standards. Nor can you ignor ethe 80-90% of your site visitors that will be using IE. Despite W3C efforts, the REAL effective standard is what the majority browser does .. that is still IE by an enormous margin.
Yes .. it would be nice if IE was BOTH an excellent, bugfree, standard compliant browser (if such a thing existed) AND was also the most widespread. But its not the former and is (for better or worse) the latter.
You certainly make a valid point, one that has been proven many times. We only need to look at the VHS vs BETA battle of the last decade. BETA was clearly a better format, but the masses went with VHS. Some pro studios are still using BETA today! We’re dealing with the same thing right now in the world of HD DVD’s…
I test all of my websites on as many browsers as I can get my hands on. I have six different browsers installed on my PowerMac and I test everything I do with all of them. If I didn’t care about 80% of my users, I wouldn’t have gone to the trouble to do all of that – not to mention going to the trouble of testing on Windows. My point is only that I wish we could learn from our past and our MISTAKES. We’ve seen how standards can benefit the user as well as the developer. It all comes down to power – power that MS is not willing to relent for the good of the web dev community as well as all of it’s users.
More On Web Standards
All of this stuff is why I’m so frustrated with the EMBED issue that started all of this. I have been fairly confident (like Bobby mentioned) until now that something I design in Flash will look pretty darn close to the same on every browser/OS combination out there. The only hitch is whether or not the user has a Flash plugin. I also hate it to make users click more than they have to… The FlashObject link I mention at the end of the article is a great solution. While it’s a little more work up front in changing your HTML, it does encapsulate a lot of functionality that we’d all benefit from. It allows users with no JavaScript and no Flash plugin to see an HTML replacement to your Flash movie. It also does version checking on the Flash plugin for you. It is the best solution I’ve found yet, but it doesn’t work for other active content (QT, …).
Thanks for the discussion thus far – change always starts small.
Ben
Regarding IE vs FireFox: here’s a site with an interesting campaign…
http://browsehappy.com/
Ben
My name was listed as Bobby Breaux previously, but I didn’t know that I didn’t need my last name.
Not to get off the subject, but does anyone know the name of the web site that offers all the browser profiles?
I’ve got a client who is on a Mac telling me that my .NET work is incompatable with her freakin’ Safari browser.
wow roger, you’re an idiot. do you work for microsoft? IE is the walmart of browsers, forcing good designs to be dumbed down and changed because they refuse to make a capable browser. If Firefox on Macs was the universal broswer the web would be much more beautiful and approachable for everyone.
Justin,
Are you serious? How much work do you do? Microsoft has been seriously rasing the bar when it comes to all things web, from security to applications to programs to code and develop sites in. Firefox? Isn’t that just Netscape in disguise? I like my Netscape browser and use it every day, but it isn’t as good as IE. The only reason that I don’t use IE is because everyone who writes virus and spyware programs targets IE. That’s why Microsoft has developed into security experts.
All you guys that are dogging on Microsoft musn’t be working too much, otherwise you would understand the importance of IE in the “real” world. Try coding hacks for applications so that they will work in “Safari” and you’ll catch my drift. We don’t do that unless it’s a special request, and I’ve only had one in the last 6 years. It’s hard to justify programming apps for Safari when only .01% of the population uses it, and those are all designers anyway, so they probably wouldn’t know how to use an application.
By the way, did you hear that Mac is now supporting the Windows OS? I don’t think that they even believe in themselves anymore.
No, I don’t work for Microsoft. Why, do you work for Apple or Firefox, Justin? Surely you must do because you are promoting them, right?
Other than the “idiot” comment (right back at you on that one for saying so) .. I agree with you 100%. What you say is really the same as what I’ve been saying.
Yes, it would be wonderful if there was a universal browser that conformed to all the web standards and had no bugs. Whether that browser were called IE or Firefox or JustinSuperBrowser, it would indeed be a wonderful world (especially for the maker of that browser who would have an absolute monopoly).
But thats simply not the case.
I’m a realist, and back in the REAL world, away from the ‘universal firefox on mac’ fantasy land Justin would like to live in, good designs DO indeed have to be ‘dumbed down’ and various hacks and special cases added to make them work for as many visitors as possible.
That is simply because there ARE imprefect browsers and imperfect platforms, and always will be (unless Justin rules the world and decrees we should all use macs and firefox from which all bugs are removed). No amount of wishing that Internet Explorer and Windows would disappear will change that.
Did you see me say anywhere that it was a GOOD thing that Internet Explorer is the most common browser and that it was a GOOD thing the it does not conform to the web standards? It is far from being a good thing. However, the fact remains that Internet Explorer is the most common browser and it does not conform to the standards .. whether you like it or not (and whether I am an idiot or not).
Funny, but I think we’re all saying the same thing – just from different perspectives…
Perspective 1: The Realist
This person uses a PC because they always have and they know how to use it well. They also know that the majority of end-users out there use Windows and IE, which validates their choice. Typically this person doesn’t want anything to do with Apple, FireFox or web standards because, in their mind, the only thing that matters is what the public does. This person doesn’t associate standards with improving the state of the web, which means that Safari and FireFox are a thorn in their side. From this perspective, IE is the development environment and Safari and FireFox (as well as Opera and all the others) are the browsers requiring hacks and work-arounds.
Perspective 2: The Idealist
This person may use a Windows machine or a Mac, but they believe in a greater good for the web. They do their best to develop sites according to W3C standards – which means that they probably don’t use Internet Explorer regardless of their OS of choice. They also have a concern for usability and screen-reader compatability. For this person, it’s frustrating even if there is just one browser/OS combo out there somewhere that doesn’t display their design properly. From this perspective, a “standards compliant” broswer is the development environment and non-standards compliant browsers on all OS’s are the browsers requiring hacks and work-arounds.
Now, I’m certainly not claiming that every web developer out there falls into one of these two molds, but I think there are some patterns here for people to consider.
I believe the reality is actually some combination of the two. We are in a state now where most end-users are on Windows/IE. To ignore that is not an intelligent decision, regardless of your convictions about web standards. However, it’s also not a smart move to ignore all the other OS/browser combos out there. Web standards will help everyone’s browsing experience and for this reason, we (as developers) need to communicate our desire for more compliance in ALL browsers to their manufacturer. It might be true that IE has the farthest to come, but we can’t just sit back and complain about it. Start desiging/coding with this in mind. It might take you longer up front, but start asking your clients to consider paying a little more for a standards compliant design. This will pay for itself in the long-run. When all the people still desiging with tables for layout realize that their sites are no longer properly contextualizing their content, they’ll need to re-code. Trust me – it will cost more to get back into the site and solve these problems than to do it right the first time.
One other thing – not all designers have no idea how to use applications. I am a programmer and a designer and I take specific offense to the idea that creative people can’t understand a technical application. In fact, design applications are some of the most complex software packages out there! I’d challenge any application developer to jump into PhotoShop cold turkey and get much done at all…
Let’s try to keep the personal attacks out of this discussion, k?
Just my thoughts.
Ben
Ben,
I’m sorry about the designer attack. It came out of frustration with Justin. I have used Photoshop for 7 years, as a design tool for creating web designs (now, I follow up on my designers mockups by detailing his designs that he gives me, adjusting them so that they will translate into a functional website) and as a photo editing tool to enhance photographs that we take for our clients with professional cameras for their web sites. I’ve also edited photos for sites from professional photographers who work all over the world – and I also program applications.
I’m with Ben – we’re all experiencing frustrations because we have to see our designs interpreted differently in each browser, and standards would prevent that. I think anyone who slams Microsoft is underestimating them. History repeats itself, and Microsoft has proven to persevere through the years, correcting their shortcomings and going beyond their competitors. Soon, Norton will be a thing of the past, I’m afraid to say that I think Mac OS’s will become extinct, and the way it’s looking, so will Dreamweaver.
Bob – no worries man. Just didn’t want this thread to get out of hand with “idiot” comments.
Another thought…
I heard a rumor about FireFox being installed along side IE on new boxes from Dell. Anyone else heard anything about this? I’m sure MS wouldn’t make it the default, but this could still be a big deal.
Ben
Hi All,
I can’t believe there’s a discussion about Windows vs Mac here, lol – in 2006. Would anyone like to consider Linux and BSD?
The point of the W3C is to provide open standards – so the web works for everyone. So that content is accessible – for example, for visually impaired users etc. If you’re a web dev, your code should validate. Otherwise, no matter where you work, you’re not really a web dev, you’re an intranet dev…. And your code should work on (as much as possible) all platforms / browsers – otherwise you’re not a good web dev. These comments are general as to the definition of a web dev and the quality of development and not personal attacks :)
The point to consider is the fact the Microsoft is a member of the W3C. Yes, they actually particpate in backing the standards they fail to conform to – for example CSS2.
Why? To retain market share, simply. Fair enough..
The problem is that any company who prioritises retaining market share over usability (including accessibility) cannot survive (in the same way they have previously) indefinitely in an open market. Every day, particularly in Europe for example, the marketplace is opening up, open standards are becoming a priority for public and private organisations.
There are two outcomes – a worsening of compatibility and relegation of open standards: there is much too much money to be lost by the rest of the business world outside Microsoft ( for example, a couple of these poeple: ) and some other big places, like governments and the EU etc (and the ROTW)…
The other (likely) outcome is that the majority of providers play ball and open standards continue to grow – as they always have. Then, the rest of ‘devs’ who don’t meet them will probably have their own little network – and all the money will be on the other one, ;)
No single company will ever define open standards. They used to define ’standards’ alright, but that was in the eighties – and they certainly, most often weren’t open..
Just like we fallible humans like to have ‘what most people have’, so does business. They want to target the largest market. The open market is always the largest and it is caused by competition. You can’t abuse a monopolistic position, you know – there are laws against that ;)
Firefox is being installed everywhere (even by manufacturers) because IE (by Microsoft’s own admisssion) is deeply integrated into the OS. This makes it a massive security risk – and is why we’ll see many more compromises. For example, the JS stated here is technically one… the users believe this is not possible, as Microsoft tell them it’s not. A lack of honesty or skill? Or both? You decide ;)
d.
PS. Have fun, think about making accessible content – and making the web a fun place! Peace to all the web devs – keep innovating *outside the box, inside the standards* ;)
Mac vs Windows? No, this is about MS and their crappy software vs quality. Those of you vigorously defending MS do so because MS dumbs down their apps and in doing so making those who don’t have the knowledge or understanding to see that as it is being made more ‘user-friendly’, ‘easier to use’, more accessible…they are being fed garbage. The microsoft way is not in anyway better, more functional or more compliant. It is crap code slopped out for the ignorant masses who don’t realize they are losing out.
Get real.
Dear All,
I find the best solution to solve the Click to activate problem of flash objects in IE 7, User the following steps.
Why do we get a message prompting me to “click to activate and use this control” when I hover my mouse over a Flash element?
This is a caused by the latest I. E. update.
Microsoft recently lost a legal battle with a patent holder about the way Internet Explorer displays OBJECTs and EMBEDs in webpages. Microsoft then decided to update its Internet Explorer browser with changes requiring user input to display and activate ActiveX based media.
This affects Flash files, QuickTime, RealPlayer, Java , Adobe Acrobat among others. It means users have to click the object first in order to activate its functions.
To fix the problem, please follow these steps:
1) Just below the last in your HTML page, insert the following Javascript:
2) Open a new document in Notepad or your HTML editor, and copy & paste the following content into it:
theObjects = document.getElementsByTagName(“object”);
for (var i = 0; i < theObjects.length; i++) {
theObjects[i].outerHTML = theObjects[i].outerHTML;
}
3) Save this file as fixit.js
4) Upload both files to your webserver, and the problem will be solved solved.
Check for example my clients site http://www.ages.com.pk which I have fixed by this script