在Internet Explorer手机中播放声音6 [英] Playing sound in internet explorer mobile 6
问题描述
我们有一个Web应用程序,目标是在Internet Mobile Explorer 6上工作。当用户输入错误的输入时,我们需要播放声音。知道手机6支持什么以及如何实现这一点?
we have a web application which is targeted to work on Internet Mobile Explorer 6. We need to play a sound when the user inputs an incorrect ... "input". Any idea what is supported on ie mobile 6 and how I can achieve this ?
提前致谢。
推荐答案
我知道这个问题有些陈旧,但我认为它仍然值得回答。这就是我如何运作的方式。如果您只是针对IE6移动版,您的头标记中可能会出现以下内容:
I know this question is somewhat old, but I think it still deserves an answer. This is how I got it working. If you are only targeting IE6 Mobile, you could so something like the following in your head tag:
<bgsound id="bgSoundId" loop="0" volume="100" />
然后有一个类似的JavaScript函数:
And then have a JavaScript function like so:
function playSound() {
document.getElementById("bgSoundId").src = "path/to/file.wav";
}
那么,你只需从验证逻辑中调用该函数。
So, then you just call that function from your validation logic.
这篇关于在Internet Explorer手机中播放声音6的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!