This function below doesn't work like I want it to;
(下面的这个功能不像我想要的那样工作;)
being a JS novice I can't figure out why. (作为一个JS新手我无法弄清楚为什么。)
I need it to wait 5 seconds before checking whether the newState
is -1
.
(我需要等待5秒才能检查newState
是否为-1
。)
Currently, it doesn't wait, it just checks straight away.
(目前,它不会等待,它只是立即检查。)
function stateChange(newState) {
setTimeout('', 5000);
if(newState == -1) {
alert('VIDEO HAS STOPPED');
}
}
ask by copyflake translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…