首页 > web前端 > js教程 > Javascript miscellanea -display data real time, using window.status_典型特效

Javascript miscellanea -display data real time, using window.status_典型特效

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
发布: 2016-05-16 19:21:38
原创
1183 人浏览过




In the above example,one have a loop and display it real time use innerHTML property, another is use window.status.

However, the window.status in real time that perfect display the loop digit, but the innerHTML property is not.
Just display result digit: now process is "999".

And how to using innerHTML display real time data? can but use window.setTimeout, or window.setInterval method, like this:

 var cnt=0;
 function finnerHtml() {
 if (cnt++>=1000) return;
 document.getElementById("demo").innerText = "now process is \"" +cnt+ "\"";
 window.setTimeout(finnerHtml,10)
 }

But, it's no convenient. the display speed is not well, and we must control something.
e.g.
setTimeout variables, when it completely.

So, I propose winodw.status to replace innerHTML property when display in real time. 
相关标签:
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
怎么实现 JavaScript点与圆的位置关系
来自于 1970-01-01 08:00:00
0
0
0
JavaScript钩子函数是什么?
来自于 1970-01-01 08:00:00
0
0
0
c++ 调用javascript
来自于 1970-01-01 08:00:00
0
0
0
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板