![](/img/trans.png)
[英]how I play .Wav sound in IE7,IE8,Safari and other supported browser using javascript
[英]Play sound using javascript in safari
我想播放聲音onclick事件。 我有可以在Firefox和其他瀏覽器中播放聲音但不能在Safari中播放聲音的代碼。 下面是代碼。 Safari給我類似"thissound.Play" [undefined ] is not a function
的錯誤"thissound.Play" [undefined ] is not a function
。
function EvalSound(soundobj) {
var thissound= eval("document."+soundobj);
thissound.Play();
}
<embed src="namaste_london01(www.songs.pk).mp3" autostart=false width=0 height=0 name="sound1"
enablejavascript="true">
<a href="#" onClick="EvalSound('sound1')"> Play </a>
提前致謝。
jQuery有一些很棒的音頻插件。 這也意味着您可以擺脫討厭的onclick屬性,從而將所有JavaScript保留在script標簽之間。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.