<section class="music rotate"> <audio loop src="/static/wishChina/music1.mp3" id="audio_play" autoplay preload></audio> </section> //下面爲jquery處理,加載完成,則調用該方法,播放音樂 function audioAutoPlay(id) { var audio = document.getElementById(id); audio.play(); document.addEventListener("WeixinJSBridgeReady", function () { audio.play(); }, false); document.addEventListener('YixinJSBridgeReady', function () { audio.play(); }, false); }