Flash loads twice workaround?

瘦欲@ 提交于 2019-12-04 05:19:39
<script>
  function loadswf()
  {
     swfobject.registerObject("myobj", "9.0.0");
  }
  function init() 
  {
     window.setTimeout("loadswf()", 0);
  }
</script>
<body onload="init()">

 <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="778" height="198" id="myobj">
    <param name="movie" value="style.swf">
    <param NAME=FlashVars VALUE="url={{stylelist}}">
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="style.swf" width="778" height="198">
     <param name="flashvars" value="url={{stylelist}}">
    <!--<![endif]-->

    <a href="http://www.adobe.com/go/getflashplayer">
    <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
                    </a>
    <!--[if !IE]>-->
    </object>
    <!--<![endif]-->
 </object>             

Make sure you're setting the Cache and Expires headers in the response. I had a similar issue with a pdf in an object tag, calling the server twice. Setting the Expires header to be 5 seconds after the current time prevented the second call. HTH

This can also be caused by improperly configured CDNs, where they might be not sending the full content or throwing a 206 or other http error.

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