2013-10-22 25 views
0

iframe視頻對象未在Chrome上加載,同樣在IE和FF中加載。研究並嘗試了很多工作來解決問題;但至今沒有取得任何成功。請在下面找到我使用的代碼並幫助解決問題。iframe視頻對象沒有加載到Chrome瀏覽器,同樣在IE和FF中加載

<div id="videoget" style="width:800px !important; height:300px !important;"> 
<script> 
if(document.URL.indexOf("video-id") == -1){ 
    document.write("<img style='margin:150px 400px 150px 400px !important;' height=20 width=20 src=/ajax-loader.gif> 
<iframe src='gpage/video-id/9yZnYzYTuyeruyuweyruweyuryuewy'width=0 height=0></iframe>"); 
} 
</script> 
</div> 

<style> 
object { 
width: 800px !important; 
height: 334px !important; 
} 
#videoget{ 
margin-top:15px; 
margin-bottom:50px; 
} 
</style> 








jQuery(function() { 
    setTimeout(function() { 
     var iframenew = document.frames; 
     if(iframenew == null){ 
     jQuery(function() { 
       var timerId = setInterval(function() { 
       var iframeano = window.frames; 


       if(iframeano!=null) { 
         var video1 = jQuery('iframe').contents().find('object').last();; 
         jQuery('#videoget',top.document).html(video1); 
         clearInterval(timerId); 
            } else {} 
                 },5000); 
       }); 

     } 
     else 
     { 
      var video = jQuery('iframe').contents().find('object').last();; 
      jQuery('#videoget').html(video); 
     } 





    }, 5000); 
}); 

回答

0

didnt檢查啥子它做你的腳本,但你有一些奇怪的東西存在,mybe這將做媒體鏈接...

jQuery(function() { //<-- this is enough 
    setTimeout(function() { 
     var iframenew = document.frames; 
     if(iframenew == null){ 
      //jQuery(function() { //<-- no need for that again... 
      var timerId = setInterval(function() { 
        var iframeano = window.frames; 
        if(iframeano!=null) { 
          var video1 = jQuery('iframe').contents().find('object').last(); //; <-- only 1 
          jQuery('#videoget',top.document).html(video1); 
          clearInterval(timerId); 
        } //else {} <-- no need for else here... 
       },5000); 
      //}); 
     } 
     else 
     { 
      var video = jQuery('iframe').contents().find('object').last(); //;<-- only 1 
      jQuery('#videoget').html(video); 
     } 
    }, 5000); 
}); 
+0

能正常工作,在IE和FF,它只是當我嘗試在Chrome上做,它失敗。雖然我提出了改變建議,但還沒有取得任何成功。 –

+0

控制檯中是否有錯誤? – reyaner

+0

也許你可以做一個小提琴,所以我可以測試鉻? – reyaner

相關問題