jquery
  • html
  • jquery-ui
  • google-chrome
  • flash
  • 2011-02-02 169 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

    相关问题