本帖最后由 weiwuyuan 于 2013-01-19 14:30:49 编辑

解决方案 »

  1.   

    <!DOCTYPE HTML>
    <html>
    <head>
    <meta charset="gbk" />
    <title></title>
    <style>
    div {
    border:1px solid red;
    }
    </style>
    </head>
    <body>
    <div id="test"></div>
    <script type="text/javascript">
    function PlaySound(file)
    {
    var str = '<embed id="read_sound" autostart="true" src="'+ file +'"></embed>';
    document.getElementById('test').innerHTML = str;
    }
    PlaySound('test.swf')
    </script>
    </body>
    </html>
      

  2.   

    多谢!可否再多问一个问题?
    就是加了一个play()语句,可是播放不了音乐: function PlaySound(file)
    {
    var str = '<embed id="read_sound" autostart="false" src="'+ file +'"></embed>';
    document.getElementById('read_sound').outerHTML = str;
    read_sound.play();
    }
    网页显示有错误,代码有问题么?
      

  3.   

        在ie中第一次加载embed标签 很慢