假如我想每隔两秒就输出一句hello world
<script type="text/javascript">
var c=1;
var t;
function timedCount()
{
while(c>0)
{
t=setTimeout("document.write('hello world')",2000);
}
}
</script>
body中按钮button设置onclick=“ timedCount()”,为什么不输出啊
小白求解
...全文
1316打赏收藏
关于javascript的定时问题
假如我想每隔两秒就输出一句hello world var c=1; var t; function timedCount() { while(c>0) { t=setTimeout("document.write('hello world')",2000); } } body中按钮button设置onclick=“ timedCount()”,为什么不输出啊 小白求解