JavaScript睡眠/等待繼續我有一個JavaScript代碼,我需要添加一個睡眠/等待功能。我正在運行的代碼已經在一個函數中,例如:function myFunction(time){
alert('time starts now');
//code to make the program wait before continuing
alert('time is up')}我聽說可能的解決方案可能包括setTimeout但我不知道如何在這種情況下使用它。我不能使用PHP,因為我的服務器不支持它,雖然使用jQuery會很好。
JavaScript睡眠/等待繼續
墨色風雨
2019-08-26 09:28:35