Posted on 2007-03-22 20:46
Jaunt 閱讀(669)
評論(0) 編輯 收藏 所屬分類:
JavaScript
setTimeout(Expression,DelayTime),在DelayTime過后,將執行一次Expression
setInterval(expression,delayTime),每個DelayTime,都將執行Expression
<!DOCTYPE?html?PUBLIC?"-//W3C//DTD?XHTML?1.0?Transitional//EN"
????"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html?xmlns="http://www.w3.org/1999/xhtml"?xml:lang="en"?lang="en">
<head>
??<title></title>
</head>
<body>
<div?id="a"></div>
<div?id="b"></div>
<script?type="text/javascript">
setTimeout("document.getElementById('a').innerHTML=
new?Date().getSeconds();",1000);
setInterval("document.getElementById('b').innerHTML=
new?Date().getSeconds();",1000);
??</script>
</body>
</html>
From:http://www.cnitblog.com/yemoo/archive/2006/06/29/13078.html