js 延时等待

 

//延时器,2秒后执行函数

function test(){
 alert("aaaa");
}

setTimeout(function () { test(); }, 2000);
//或者
setTimeout('test()',2000);

 

posted @ 2019-04-24 23:38  anobscureretreat  阅读(5232)  评论(0编辑  收藏  举报