下面程序在IE中打开时,没有错误提示,但是没有播放音乐,却打开一个下载文件的对话框!!!
请大虾们指点下为什么会这样啊????
<head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <meta name="GENERATOR" content="Microsoft FrontPage 4.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <title>Javascript Unleashed</title> <script language="javascript"> function playsound(sfile) { window.location.href=sfile; } </script> </head>
<body onload="playsound('tada.wav')"> <h2> sounds on JS Events </h2> <hr> The following are example of JS event handlers used to play sounds. <hr> <a href="#" onclick="playsound('tada.wav")"> Click here for sound </a> <p> <embed mastersound name="sound1" src="tada.wav" volume="100" hidden="true" autostart="false" width="128" height="128"> <form name="form1"> <input type="button" value="play" onclick="document.sound1.play(true)"> <input type="button" value="pause" onclick="document.sound1.pause()"> <input type="button" value="stop" onclick="document.sound1.stop()"> </form> </body>