javascript延时
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>无标题页</title>
<script type ="text/javascript" >
function abc()
{
setTimeout ('alert("ok")',1000); //延时执行1000毫秒(1秒) 1秒后才执行
}
function def()
{
alert("ok");
}
</script>
</head>
<body>
<input id="Button1" type="button" value="button" onclick ="abc()"/>
<br />
<br />
<br />
<input id="Button2" type="button" value="button" onclick ="def()"/>
</body>
</html>
setInterval('sendAJAX()',1000); //每隔一秒钟执行一次sendAJAX()函数