且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

js延时函数setTimeout

更新时间:2022-06-08 20:03:11

实现一个延时执行的效果,现记录如下:

<html>
<head>
<script type="text/javascript" src="/jquery/jquery.js"></script>
<script type="text/javascript">
function alertV(){ 
    alert("000"); 
} 
setTimeout(alertV,1000); //方法一

setTimeout("alertV()",5000); //方法二

</script>
</head>

<body>

</body>
</html>

 

关于JS的demo可以在W3CSchool在线测试工具上面进行测试

http://www.w3school.com.cn/tiy/t.asp?f=jquery_manipulation_before_func