Anonymous
Anonymous asked in 電腦與網際網路網際網路其他:網際網路 · 2 decades ago

HTML音樂播放

<script language="JavaScript">

<!--

document.write('<bgsound src=# id=midijuke volume=0 loop=infinite>');

function midiplay(what) {

if (document.all) {

document.all.midijuke.src = what.options[what.selectedIndex].value;

}

else {

alert("Sorry, the Music Menu is only accessible through MSIE5.0 or above.");

}

}

-->

</script>

<LEFT>

<form name="choose">

<select size="1" onChange="midiplay(this)">

<option value="#">∥選擇音樂∥</option>

<option value="http://202.107.35.126/jsyliuxing826/476.rm%22%3EDA...

<option value="http://kj.cqit.edu.cn/Accessory/200482144133446.rm...

<option value="http://yinyue.love165.com/mtv/daodai.rm%22%3E%E5%8...

<option value="http://218.25.10.36/jsyliuxing826/58.rm%22%3E%E6%8...

</select>

</form>

</SCRIPT>

請問哪邊寫錯了 我放不出音樂

3 Answers

Rating
  • Melvin
    Lv 7
    2 decades ago
    Favorite Answer

    試試將rm檔的音樂改成midi或wma檔的音樂<script language="JavaScript"> <!-- document.write('<bgsound src=# id=midijuke volume=0 loop=infinite>'); function midiplay(what) { if (document.all) { document.all.midijuke.src = what.options[what.selectedIndex].value; } else { alert("Sorry, the Music Menu is only accessible through MSIE5.0 or above."); } } --> </script> <LEFT> <form name="choose"> <select size="1" onChange="midiplay(this)"> <option value="#">∥選擇音樂∥</option> <option value="

  • Anonymous
    2 decades ago

    您的語法沒有問題,我也測試過了,放不出音樂只在您提供的音樂空間有的失聯、有的無法播放,我提供我的音樂給您測試:http://home.doramail.com/shuzizeo:doramail.com/mus...

  • ?
    Lv 5
    2 decades ago

    嗯 實際測試結果

    mp3 播放沒有問題

    但 rm 檔沒試

    document.write('<bgsound src=# id=midijuke volume=0 loop=infinite>');

    volume=0 改成 80 試看看

    這個參數是音量大小 其值範圍 0~100

    你的參數為 0 所以應該會沒有聲音

    把他改掉應該就可以了

Still have questions? Get your answers by asking now.