0
這段代碼有什麼問題嗎?音頻文件不會在加載網頁時播放。jQuery fire音頻
$(document).ready(function() {
var audioElement = document.createElement('audio');
audioElement.setAttribute('src','content/audio/tune.mp3');
audioElement.setAttribute('autoplay', 'autoplay');
//audioElement.load()
$.get();
audioElement.addEventListener("load", function() {
audioElement.play();
}, true);
audioElement.play();
});
哦,不,請不要downvote!複製代碼時出錯! – Ronophobia 2013-03-22 15:35:19