jquery
  • html
  • jquery-ui
  • google-chrome
  • flash
  • 2011-02-02 118 views 0 likes 
    0

    Chrome瀏覽器中的SWF不會加載,直到除非有對格進行了點擊,我在做什麼錯加載SWF

    var html += '<div align="center"><OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="myMovieName">'; 
    
        html += ' <PARAM NAME="movie" VALUE="/media/cam.swf" /> <PARAM NAME="quality" VALUE="high" /> <PARAM NAME="bgcolor" VALUE="#FFFFFF" /> <EMBED href="/media/players/camera.swf" src="/media/players/camera.swf" quality=high bgcolor=#FFFFFF NAME="myMovieName" ALIGN="" TYPE="application/x-shockwave-flash"> </EMBED> </OBJECT></div>'; 
    
    $("#contents").append(html); 
    

    回答

    1

    裝載主權財富基金使用JavaScript的最佳方法是使用swfobject,而不僅僅是一個純字符串和jQuery。這種方式出現的問題太多了。

    一個例子:

    <!-- Include swfobject --> 
    <script src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script> 
    
    <!-- Put this somewhere on your page --> 
    <div id="place_to_put_the_swf"> 
        The content inside this div will be seen if 
        the user doesn't have flash installed. 
        Put an image, error message or whatever here. 
    </div> 
    
    <!-- This script with replace the div above with the following swf. 
        The parameters are filename, id of the div, width, height and flash version. --> 
    <script> 
        swfobject.embedSWF("file.swf", "place_to_put_the_swf", 400, 300, "7"); 
    </script> 
    

    當然你也可以使用jQuery呈現DIV,然後運行的embedSWF功能,都在你的JavaScript,如果你喜歡。

    +0

    不會.load()的工作?只是問問。 – devWaleed 2013-02-12 19:03:35

    相關問題