我该如何更新此代码

发布于 2024-07-08 09:16:15 字数 931 浏览 6 评论 0原文

   <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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

萌无敌 2024-07-15 09:16:15

您可以嵌套对象元素来显示替代项。 W3C 在此处对此进行了解释。 我复制了下面的一个片段:

OBJECT 元素设计的一个重要结果是它提供了一种指定替代对象渲染的机制; 每个嵌入的 OBJECT 声明可以指定替代的内容类型。 如果用户代理无法呈现最外层的 OBJECT,它会尝试呈现内容,这可能是另一个 OBJECT 元素等。

在下面的示例中,我们嵌入了几个 OBJECT 声明来说明替代渲染的工作原理。 用户代理将尝试按以下顺序渲染它可以渲染的第一个 OBJECT 元素:(1) 用 Python 语言编写的地球小程序,(2) 地球的 MPEG 动画,(3) 地球的 GIF 图像,(4)替代文本。

<P>                 <!-- First, try the Python applet -->
<OBJECT title="The Earth as seen from space" 
    classid="http://www.observer.mars/TheEarth.py">
                <!-- Else, try the MPEG video -->
    <OBJECT data="TheEarth.mpeg" type="application/mpeg">
                <!-- Else, try the GIF image -->
      <OBJECT data="TheEarth.gif" type="image/gif">
                <!-- Else render the text -->
       The <STRONG>Earth</STRONG> as seen from space.
     </OBJECT>
   </OBJECT>
</OBJECT>

You can nest object elements to display alternatives. The W3C explains it here. I copied a snippet below:

One significant consequence of the OBJECT element's design is that it offers a mechanism for specifying alternate object renderings; each embedded OBJECT declaration may specify alternate content types. If a user agent cannot render the outermost OBJECT, it tries to render the contents, which may be another OBJECT element, etc.

In the following example, we embed several OBJECT declarations to illustrate how alternate renderings work. A user agent will attempt to render the first OBJECT element it can, in the following order: (1) an Earth applet written in the Python language, (2) an MPEG animation of the Earth, (3) a GIF image of the Earth, (4) alternate text.

<P>                 <!-- First, try the Python applet -->
<OBJECT title="The Earth as seen from space" 
    classid="http://www.observer.mars/TheEarth.py">
                <!-- Else, try the MPEG video -->
    <OBJECT data="TheEarth.mpeg" type="application/mpeg">
                <!-- Else, try the GIF image -->
      <OBJECT data="TheEarth.gif" type="image/gif">
                <!-- Else render the text -->
       The <STRONG>Earth</STRONG> as seen from space.
     </OBJECT>
   </OBJECT>
</OBJECT>
可遇━不可求 2024-07-15 09:16:15

我建议您使用 swfobject,它是一个跨平台的开源库,用于在页面上显示 Flash。

http://code.google.com/p/swfobject/

有多种加载 Flash 和替代(非 Flash)内容的方法。 例如,以下代码可以替换您的代码:

<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
    swfobject.embedSWF("http://click-here-to-listen.com/players/iaPlay13.swf?x=1058286910FTRZGK", 
        "myContent", "25", "75", "9.0.0");
</script>
<div id="myContent">
  <p>Alternative content</p>
</div>

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:

<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
    swfobject.embedSWF("http://click-here-to-listen.com/players/iaPlay13.swf?x=1058286910FTRZGK", 
        "myContent", "25", "75", "9.0.0");
</script>
<div id="myContent">
  <p>Alternative content</p>
</div>
橘寄 2024-07-15 09:16:15

基本上,您应该保留嵌入,因为它是某些旧浏览器的后备。 它可能会损害页面的验证,但只要您知道它为什么在那里,就可以了。

至少这是 Adob​​e 官方推荐的方式: 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... :-)

心凉怎暖 2024-07-15 09:16:15

我使用函数 AC_FL_RunContent 来嵌入 flash 对象 - 它很好,因为它支持所有浏览器并且是 Adob​​e 推荐的。

更多信息在此处

他们还建议使用 标签而不是

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>

负佳期 2024-07-15 09:16:15

我在网上(来自可用性网站)找到了这段代码,它适用于 IE 和其他浏览器,我在我的 Flash 页面上使用它(我已将其更改为您的代码):

<!--[if !IE]> -->
<object type="application/x-shockwave-flash" data="http://click-here-to-listen.com/players/iaPlay13.swf?x=1058286910FTRZGK" width="75" height="25">
<!-- <![endif]-->

<!--[if IE]>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="75" height="25">
  <param name="movie" value="http://click-here-to-listen.com/players/iaPlay13.swf?x=1058286910FTRZGK" />
<!--><!--dgx-->
  <param name="loop" value="false">
  <param name="menu" value="false">
  <param name="quality" value="high">
</object>
<!-- <![endif]-->

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):

<!--[if !IE]> -->
<object type="application/x-shockwave-flash" data="http://click-here-to-listen.com/players/iaPlay13.swf?x=1058286910FTRZGK" width="75" height="25">
<!-- <![endif]-->

<!--[if IE]>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="75" height="25">
  <param name="movie" value="http://click-here-to-listen.com/players/iaPlay13.swf?x=1058286910FTRZGK" />
<!--><!--dgx-->
  <param name="loop" value="false">
  <param name="menu" value="false">
  <param name="quality" value="high">
</object>
<!-- <![endif]-->
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文