在w3c上看到的例子是这样用 setInterval()方法的。
这两个有什么不同??
<html>
<body>
<input type="text" id="clock" size="35" />
<script language=javascript>
var int=self.setInterval("clock()",50)function clock()
{
var t=new Date()
document.getElementById("clock").value=t
}
</script>
</form>
<button onclick="int=window.clearInterval(int)">Stop interval</button>
</body>
</html>self代表当前页面