我正试图让声音适用于以下HTML-JavaScript代码...但没有声音,并且程序没有说“没有声音支持”。不确定是什么问题 ??
<html>
<head>
<title>Sound Test</title>
<script type="text/javascript">
function PlaySound(){
var sound = document.getElementById("note_c1");
try{
//RealPlayer
sound.DoPlay();
}catch (e){
try{
//Windows Media / Quicktime
sound.Play();
alert("should hear sound");
}catch(e){
alert("No sound support.");
}
}
}
</script>
</head>
<body>
<h1>Sound Test</h1>
<embed id="note_c1" src="c1.au" width="0" height="0" autostart="false" enablejavascript="true"/>
<input type = "button" value="Play the Sound" onClick="PlaySound()">
</body>
答案 0 :(得分:0)