HTML alternative if plugin is not available

梦想的初衷 提交于 2019-12-11 08:14:58

问题


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)

-foot


回答1:


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.



来源:https://stackoverflow.com/questions/16065850/html-alternative-if-plugin-is-not-available

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!