<form id="form1" runat="server">
<div id="div_music">
<embed id="myMusic" src="music/xihuanni.mp3" loop="1" type="audio/mpeg" />
<%--<audio id="myMusic" loop="loop" src="/music/xihuanni.mp3" type="audio/mpeg"> </audio>--%>
</div>
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True">
<asp:ListItem Value="/music/xihuanni.mp3">喜欢你</asp:ListItem>
<asp:ListItem Value="/music/jtnyjgw.mp3">今天我要嫁给你</asp:ListItem>
</asp:DropDownList>
<script>
var ddl = document.getElementById("DropDownList1");
var aaa=ddl.options[ddl.selectedIndex].value;
var swf = aaa;//得到地址
var isIE = window.navigator.userAgent.indexOf("MSIE") > -1;
var mm = document.getElementById("div_music");
var str = '<embed id="myMusic" src="' + swf + '" loop="1" type="audio/mpeg">';
function mus() {
if (isIE) {
document.myMusic.src = swf;
}
else {
document.embeds["myMusic"].src = swf;
}
mm.innerHTML(mm);
//mm.remove();
}
window.onload = mus;
</script>
</form>
ä½ ç»ç代ç æ¾è¿å»ä¸è¡ï¼ä½ çç代ç æ¯ä¸é¢é£ä¸¤ä¸ªå¾ççå§ï¼é£æ¯è¿è¡åçæçï¼æç¨å®¡æ¥å ç´ æ¥çæªå¾ç....
追çé£å°±å建ä¸ä¸ªaudioè¯è¯
audio = document.createElement("audio")
audio.src = "url.mp3"
audio.play()
注æï¼pc端ä¸æ¯å
许åæ¶ææ¾å¤ä¸ªé³é¢æ件çï¼æ以è¿éä½ è¦å°å
¶å®çæåæã