js延时函数setTimeout

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

<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

原文地址:https://www.cnblogs.com/mr-wuxiansheng/p/6947220.html