2011-01-19 149 views
0

我有这样的代码运行在FF,歌剧和镀铬大:在Internet Explorer版本swfobject.embedSWF不加载对象在IE7和IE8

<script type="text/javascript"> 
        $(document).ready(function(){ 
         var swfUrl = "http://www.youtube.com/apiplayer?video_id=<?php echo bg_get_video_id($post->post_content)?>&enablejsapi=1&version=3&playerapiid=ytplayer_<?php echo $i?>"; 


         // allowScriptAccess must be set to allow the Javascript from one 
         // domain to access the swf on the youtube domain 
         var params = { allowScriptAccess: "always", wmode: "opaque" }; 

         // This sets the ID of the DOM object or embed tag to 'myytplayer'. 
         // You can use this ID to access the swf and call the player's API 
         var atts = { id: "ytplayer_<?php echo $i?>", class: "ytplayer"}; 
         var flashvars = {}; 
         swfobject.embedSWF(swfUrl, "ytdiv_<?php echo $i?>", "300", "120", "9", null, flashvars, params, atts); 
        }); 
       </script> 

但不是7和8是PHP的一部分文件来自Wordpress,但并不重要 - video_id和ytdiv_都可以,它可以在其他浏览器中使用。

有什么我可以做的,使其在IE中工作?对于可能造成的原因我没有任何想法。

干杯, Nebril

回答

2

这里:
var atts = { id: "ytplayer_", "class": "ytplayer"};

键入引号 “类” 和你做。它至少帮助了我。

+0

这也适用于我。谢谢 :) – Mike 2012-07-10 17:30:55

1

我不知道它是否是同样的问题,我有,但我不得不升级到SWFObject的最新版本,2.2我认为现在是,解决了这个问题对我来说。