2011-01-19 151 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我認爲現在是,解決了這個問題對我來說。