码迷,mamicode.com
首页 > 其他好文 > 详细

setTimeout 无限循环计时有bugge!

时间:2014-11-13 14:27:45      阅读:220      评论:0      收藏:0      [点我收藏+]

标签:io   ar   sp   on   cti   bs   html   ad   htm   

<html>

<head>

<script>

var i=0;

var t;

function x()

{

document.getElementById("txt").value=i;

i=i+1;

t=setTimeout("x()",1000);

}

<script/>

<head/>

<body>

<input type="button" value="点击开始计时" onclick="x()"/>

<input type="text" id="txt"/>

<body/>

<html/>       

 

 

 

<!--如果用户一直点击按钮,那么计时会变快。我称之为(不稳定现象)-->

setTimeout 无限循环计时有bugge!

标签:io   ar   sp   on   cti   bs   html   ad   htm   

原文地址:http://www.cnblogs.com/chuhun4-5/p/4094631.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!