无法直接在Javascript中进行 *** 作。您需要在HTML中嵌入一个简短的WAV文件,然后通过代码进行播放。
一个例子:
<script>function PlaySound(soundObj) { var sound = document.getElementById(soundObj); sound.Play();}</script><embed src="success.wav" autostart="false" width="0" height="0" id="sound1"enablejavascript="true">
然后,您可以这样从Javascript代码中调用它:
PlaySound("sound1");
这应该完全满足您的要求-您只需要自己查找/创建蜂鸣声,这应该是微不足道的。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)