HTML alternative if plugin is not available

2019-08-03 18:06发布

What is the best practice for displaying an HTML alternative when a browser plug-in is not available? I'm embedding the plugin with an object tag like so:

<object id="plugin0" type="application/x-myplugin"></object>

This is what an unknown plugin displays as in Google Chrome, however I'd like the solution to work on all browsers (i.e. FF plugin/Chrome plugin/IE ActiveX object)

Image of "No plug-in available" error in Google Chrome

-foot

1条回答
仙女界的扛把子
2楼-- · 2019-08-03 18:54

If you're talking about flash, whatever you place within the object tag will show up if flash is not supported.

Here's an example of a flash movie with a fallback image:

<object type="application/x-shockwave-flash data="yourmovie.swf" width="400" height="300">
<param name="movie" value="yourmovie.swf" />
<img src="noflash.gif" width="200" height="100" alt="" />
</object>

I typically test for plugins using javascript and write to the page based on the test results.

查看更多
登录 后发表回答