PDA

View Full Version : Is <embed> really necessary ?


dimijin
04-26-2010, 04:31 PM
I understand the need to provide a way for older browsers that don't handle the object tag to display our flash content but is the embed element really necessary?

If I understand this right, any old browser that uses the Netscape embedding method would need the embed element otherwise it would just crap its pants. But when you review the current browser statistics it appears that the amount of users that would be affected by the lack of an embed element are so small they don't even show up.

Using my personal site with no embed element present I tested on Mac + PC on a whole slew of different browsers and they all worked fine. I do realize I tested on more current versions though (except IE for PC but it uses object element so it doesn't matter.) It's possible I didn't test on a browser that really needs the embed element.

So I'm just wondering if there really is a need for this anymore. Do you guys still include it in your html documents and if you do why?

tadster
04-26-2010, 08:18 PM
I have not used embed since about 3-5 years ago.

We are entering a joyus time for flash, and javascript, together.
With great new browsers, that users are updating (IE8 80% FF3 15%)
And cool new features that are slowly being supported like, window.onhashchange in IE8+, FF3.6+, and Google Chrome 4+

Using swfobject 2.2, the swfobject.embedSWF method, is the best way, imo, to put a swf in your html page.

dimijin
04-26-2010, 08:40 PM
Would it be logical to assume I could change to using swfObject as my main implementation method and have a <noscript> tag which embeds via the object element for the rare case someone doesn't have scripts enabled?

tadster
04-27-2010, 12:55 AM
<div id="toBeFlash">
<noscript>
<object>......</object>
</noscript>
</div>

<!-- ... -->

<script>

swfobject.embedSWF("my.swf", "toBeFlash", .....);
</script>



You mean something like that ^ ? Yes.
But, I'm not sure, but, it may be that if you did it that way, your swf will be loaded twice. The noscript tag may not stop the object from loading up.... I could be wrong on that point though, but objects (html objects) are weird like that. Only testing with something like FireBug would tell; if two requests for the swf go through, then no, doing that is not a good option.

Normally, users really without javaScript are also users without Flash.
In my opinion, it is ok to require both JavaScript and Flash, if your going to be using Flash in any prominent way.
Everyday users without javascript, are cell phone users. It is now rare to come across a browser surfer that has javascript disabled or no javascript support at all. And for those that have choosen to disable Javascript (like me) they will turn it back on if they trust your site.

The best option is just swfobject and either its alternate ccontent option or to place a message in the "toBeFlash" div that states the need for Flash and JavaScript.

dimijin
04-27-2010, 07:28 PM
Thanks for the advice Tad, makes sense.