cuốn sách gpt4 ai đã làm

Nút phát/tạm dừng hoạt động ngoại tuyến nhưng không trực tuyến

In lại Tác giả: Walker 123 更新时间:2023-11-28 06:43:39 28 4
mua khóa gpt4 Nike

我对 Java 不是很在行,在研究网站上的音乐循环的简单播放/暂停按钮后,我得到了这段代码。它可以很好地离线测试,但在上传到 FTP 服务器后,它不会在任何浏览器中播放音频,我得到 SyntaxError: Unexpected end of input

Mã này như sau:


button{ border:none; cursor:pointer; outline:none; }
button#playpausebtn{
background:url(images/sound_on.png) no-repeat;
width:20px;
height:20px;
}


var audio, playbtn, seek_bar;
function initAudioPlayer(){
audio = new Audio();
audio.src = "newsongs/Geboren__xsm2.mp3";
audio.loop = true;
audio.play();
// Set object references
playbtn = document.getElementById("playpausebtn");
// Add Event Handling
playbtn.addEventListener("click",playPause);
// Functions
function playPause(){
if(audio.paused){
audio.play();
playbtn.style.background = "url(images/sound_on.png) no-repeat";
} khác {
audio.pause();
playbtn.style.background = "url(images/sound_off.png) no-repeat";
}
}
}
window.addEventListener("load", initAudioPlayer);

câu trả lời hay nhất

没关系,我只是发现了自己的错误。评论标签导致它无法正确加载!

关于javascript - 播放/暂停按钮离线工作但不在线,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34158389/

28 4 0
Chứng chỉ ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com
Xem sitemap của VNExpress