如何在PHP中每30分钟创建一次闹钟?
<script type="text/javascript">
function closeWindow() {
setTimeout(function() {
window.close();
}, 1800000);
}
window.onload = closeWindow();
</script>
</head>
<body>
<audio controls autoplay="autoplay">
<source src="apple_ring.mp3" type="audio/mpeg">
答案 0 :(得分:1)
删除所有关闭窗口,然后尝试此操作。
<audio id="alarmAudio" controls autoplay="autoplay">
<source src="apple_ring.mp3" type="audio/mpeg">
</audio>
<script>
var alarm = document.getElementById("alarmAudio");
setInterval(function(){
alarm.play();
}, 1800000);
</script>