Using object fallback
Many people want to use flash or other similar plugins, that arent guaranteed to have support by the users browser. The defacto standard seems to be to use Frontpage or Dreamweavers default object export, which of course is neither standards compatible, userfriendly or using any of the cool behaviors the object tag really supplies.
This is an example of a default flash inclusion that is auto generated:
Now, there are several things wrong with the shown example. First of all it doesnt validate.
<embed> never was a part of the w3c recommendations for HTML. Its a proprietary Netscape tag, and it has been obsolete since Netscape 5+.The above code also states, that if the user doesnt have the plugin required to view the object, it will annoy the user with a message to get their ass to the download page and isntall the needed plugin. This approach shows serious mentality problems for a webdesigner. Designing a webpage is not about stuffing your version of things down the users throat. Designing a webpage is about accessibility, about the ability to view content as you prefer it, and about always ALWAYS being sure that people without the advanced plugins, or the ability to install them, will also be able to access your page properly.
Now, the right way to do things would be to check if the user has the desired plugin, and if not, supply an alternative content to the user. I have seen quite many javascript hacks to reach this goal. Well, actually most of them still only prompted the user to download the plugin, but anyway, much much javascript.
Object fallback to the rescue
The guys at the W3C arent that stupid sometimes. When used correctly, the object tag tests for existance of the needed plugin. If it cannot find the plugin it goes on to parse the content of the object tag.
This means that all you have to do is add the same content, just with html inside the object tag. Extremely simple, userfriendly, javascript-free and nobody kills any kittens. I have included an example of a correct flash inclusion with fallback here:
Remember to adapt the dimensions to your flash/image
You can of course supply any alternative content that you like, all depending on what the flash is showing. Manu people like flash menus, so in that case you include a link list that takes you to the same locations.
Of course pages that are entirely dependant on flash wont work this way. But people who do thos, either know what they are doing (writing a closed application), or should be the first against the wall when the webdeveloper revolution comes.
on March 15th, 2007 at 6:54 pm
Does not seem to work for Mozilla and Firefox …
on March 16th, 2007 at 11:14 am
What fails Siegfried?
I have an example running at http://fumle.dk/public/html/flash/ that includes the flash fine, and falls back to an image if the flash version is not supported or the plugin not installed. Works fine in Gecko as well.
on April 3rd, 2007 at 12:11 am
Just to note: although this does work in IE, because of the browsers incorrect implementation of the object element, it will not stream content.
so your entire swf has to load before IE will display it.
here’s hope IE.next will support this properly.
in the meantime you can use conditional comments like so:
–>
Its quite ugly, but it works it validates and it displays alternate content proplery.