javascript延迟,时间延迟执行


function delay(numberMillis){ 
        var now = new Date(); 
        var exitTime = now.getTime()+numberMillis;    
        while(true){ 
                now = new Date(); 
                if(now.getTime() > exitTime) 
                        return; 
        } 
}  
document.write("<script language='javascript' src='js1.js'></script>"); 
delay(1000); 
document.write("<script language='javascript' src='js2.js'></script>"); 
delay(1000); 
document.write("<script language='javascript' src='js3.js'></script>"); 
delay(1000); 
document.write("<script language='javascript' src='js4.js'></script>"); 
delay(1000); 
document.write("<script language='javascript' src='js5.js'></script>"); 
delay(1000); 
document.write("<script language='javascript' src='js6.js'></script>"); 
delay(1000); 
document.write("<script language='javascript' src='js7.js'></script>"); 
delay(1000); 
document.write("<script language='javascript' src='js8.js'></script>");

《“javascript延迟,时间延迟执行”》 有 1 条评论

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

验证码 * Time limit is exhausted. Please reload CAPTCHA.