Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/84.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在javascript中为消息通知添加嘟嘟声?_Javascript_Jquery_Asp.net_Notifications_Beep - Fatal编程技术网

如何在javascript中为消息通知添加嘟嘟声?

如何在javascript中为消息通知添加嘟嘟声?,javascript,jquery,asp.net,notifications,beep,Javascript,Jquery,Asp.net,Notifications,Beep,添加了显示消息通知的示例。无论何时显示,都必须添加蜂鸣音。它几乎模仿桌面警报这样的行为 任何人都能找到解决方案吗?这应该会有帮助 <script> function PlaySound(soundObj) { var sound = document.getElementById(soundObj); sound.Play(); } </script> <embed src="success.wav" autosta

添加了显示消息通知的示例。无论何时显示,都必须添加蜂鸣音。它几乎模仿桌面警报这样的行为

任何人都能找到解决方案吗?

这应该会有帮助

<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">

功能播放声音(soundObj){
var sound=document.getElementById(soundObj);
声音。播放();
}

谢谢您的快速回复。怎么可能是“soundObj”?它是语音文件还是将使用客户端系统文件?您已经添加了声音文件并将该声音用作蜂鸣音。它支持哪些语音文件扩展名?请参阅此处更新的答案: