【发布时间】:2014-11-23 09:19:19
【问题描述】:
音频正在笔记本电脑和 PC 中播放,但未在 ipad 中播放。我尝试了不同的 ipad,但它没有播放音频。
<script>
jQuery(document).ready(function(){
var audioElement = document.createElement('audio');
audioElement.type='audio/mpeg';
audioElement.setAttribute('src', '/*file url over here*/');
audioElement.setAttribute('autoplay', 'autoplay');
$.get();
audioElement.addEventListener("load", function() {
audioElement.play();
}, true);
audioElement.play();
});
</script>
【问题讨论】:
-
我找到了答案。 $.get();应该是 jQuery.get();.
标签: javascript html ipad audio