我该如何更新此代码
<object height="25" width="75" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">
<param value="http://click-here-to-listen.com/players/iaPlay13.swf?x=1058286910FTRZGK" name="movie"/>
<param value="high" name="quality"/>
<param value="#FFFFFF" name="bgcolor"/>
<param value="opaque" name="wmode"/>
<embed height="25" width="75" wmode="opaque" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" bgcolor="#FFFFFF" quality="high" src="http://click-here-to-listen.com/players/iaPlay13.swf?x=1058286910FTRZGK"/>
</object>
我必须将此遗留标记插入到我正在构建的新网站中。 问题是它使用 标签。
对于那些没有闪存的人来说,我是否可以取消 并添加一些内容作为替代方案? 基本上我只是想把这段html带入21世纪。
<object height="25" width="75" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">
<param value="http://click-here-to-listen.com/players/iaPlay13.swf?x=1058286910FTRZGK" name="movie"/>
<param value="high" name="quality"/>
<param value="#FFFFFF" name="bgcolor"/>
<param value="opaque" name="wmode"/>
<embed height="25" width="75" wmode="opaque" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" bgcolor="#FFFFFF" quality="high" src="http://click-here-to-listen.com/players/iaPlay13.swf?x=1058286910FTRZGK"/>
</object>
I am having to insert this legacy markup into a new site that I'm building. Problem is its using an <embed>
tag.
Would I just do away with the <embed>
and put some content in as an alternative, for those that do not have flash? Basically I'm just trying to bring this piece of html into the 21st century.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您可以嵌套对象元素来显示替代项。 W3C 在此处对此进行了解释。 我复制了下面的一个片段:
You can nest object elements to display alternatives. The W3C explains it here. I copied a snippet below:
我建议您使用 swfobject,它是一个跨平台的开源库,用于在页面上显示 Flash。
http://code.google.com/p/swfobject/
有多种加载 Flash 和替代(非 Flash)内容的方法。 例如,以下代码可以替换您的代码:
I recommend that you use swfobject which is a cross platform, open source library to display flash on your pages.
http://code.google.com/p/swfobject/
There are a variety of ways to load the flash and the alternative (non-flash) content. For example the following code could replace your code:
基本上,您应该保留嵌入,因为它是某些旧浏览器的后备。 它可能会损害页面的验证,但只要您知道它为什么在那里,就可以了。
至少这是 Adobe 官方推荐的方式: Macromedia Flash OBJECT 和 EMBED 标记语法
您想要为 21 世纪编写代码是对的,但我们必须处理上个千年的浏览器......:-)
Basically, you should keep embed, because it is a fallback for some old browsers. It might hurt validation of page, but as long as you know why it is there, it is OK.
At least that's the way Adobe officially recommends: Macromedia Flash OBJECT and EMBED tag syntax
You are right to want to do code for XXIth century, but we have to deal with browser from previous millennium... :-)
我使用函数 AC_FL_RunContent 来嵌入 flash 对象 - 它很好,因为它支持所有浏览器并且是 Adobe 推荐的。
更多信息在此处:
他们还建议使用
I use function AC_FL_RunContent for embedding flash objects - it's good because it supports all browsers and is recommended by Adobe.
More is here:
They also suggest using <object> tag instead of <embed>
我在网上(来自可用性网站)找到了这段代码,它适用于 IE 和其他浏览器,我在我的 Flash 页面上使用它(我已将其更改为您的代码):
I found this code on the web (from a usability site) which caters for IE and others, and I use it on my flash pages (I've changed it to your code):