我使用以下脚本在延时后播放 2 个声音文件
<html>
<head>
<script language="javascript" type="text/javascript">
function playSound(soundfile,soundfile1)
{
document.getElementById("sound").innerHTML= "<embed src=\""+soundfile+"\" hidden=\"true\" autostart=\"true\" loop=\"true\" />";
setTimeout(function(){document.write ('<EMBED src= "' + soundfile1 + '" hidden=true autostart=true loop=false>')},2000);
setTimeout(function(){alert("You have successfully launched the MedOrient website! \n Thank you for launching Sri sai medical jobs.");},3000);
setTimeout("window.location='http://url'",8000);
}
</script>
</head>
<body>
<a href="#" onclick="playSound('clapping.mp3','fireworks56.mp3');" ><img src="ribbon-cutting.jpg"/></a>
</body>
</html>
这在 Chrome 中有效,但在 firefox 或 IE 中无效。soundfile1(fireworks56.mp3) 在几(大约 8)秒后播放,但它不会重定向。在它显示的Firefox状态栏中,
Read http://url