IE7~10的困惑,请各位大侠亮亮剑!
问题1 使用win7/IE7~10在切换播放音频时无法停止前面播放的音乐,而是点几首就几首混在一起播放,本人对JS认识太少,任凭如何试弄都不得法,如今已是山穷水尽,希望各位大侠亮亮剑,帮助在下解开困惑已久的难题,本人在此先说声谢谢了。
问题2 想增加打开本地音频文件播放功能,最好能支持火狐和谷歌(以防以后又麻烦)。
问题3 可能的话增加一个输入框可以输入或粘贴上网址播放。
首次发帖请大家多多支持!
<script>
function aaa(u){
if (document.getElementById("play")) {document.body.removeChild(document.getElementById("play"));}
var bodyer=document.createElement("embed");
bodyer.setAttribute("id","play");
bodyer.setAttribute("width","280");
bodyer.setAttribute("height","40");
bodyer.setAttribute("src",u);
bodyer.setAttribute("wmode","Opaque");
bodyer.setAttribute("wmode","transparent");
document.body.appendChild(bodyer);
}
</script>
<input value="往事只能回味" type="button" onclick="aaa('http://www.xjclub.com/ml/luyin/wangshihuiwei09.mp3');" />
<input value="濤聲依舊-毛寧" type="button" onclick="aaa('http://www3.kyukyo-u.ac.jp/t/k023/forxyl.mp3');" />
<input value="愛我中華" type="button" onclick="aaa('http://www.hnxgl.cn/gongh_subsite/upload_files/File/3.WMA');" />
<input value="青海湖边的小卓玛" type="button" onclick="aaa('http://www.kid-music.cn/uploads/2013klygmp3/41青海湖边的小卓玛.mp3');" />