最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Javascript miscellanea -display data real time, using window.status

 更新時(shí)間:2007年01月09日 00:00:00   作者:  
<script type="text/javascript">
 //<![CDATA[
 function fstatus() {
 for (var i=0; i<100000; i++) {
 window.status = "now process is \"" +i+ "\"";
 }
 }
 function finnerHtml() {
 for (var i=0; i<1000; i++) {
 document.getElementById("demo").innerHTML = "now process is \"" +i+ "\"";
 }
 }
 //]]>
 </script>
<input type="button" onclick="fstatus()" value="test status"/>
<input type="button" onclick="finnerHtml()" value="test innerHTML"/>
<div id="demo"></div>
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. 

相關(guān)文章

最新評論

兴仁县| 迁西县| 广元市| 牟定县| 曲阜市| 汉川市| 鄯善县| 蛟河市| 竹溪县| 嘉义县| 视频| 姜堰市| 宿州市| 定南县| 呈贡县| 大丰市| 东光县| 房产| 呈贡县| 乌兰县| 黑水县| 连州市| 伊金霍洛旗| 本溪市| 榆树市| 洛阳市| 漾濞| 黎平县| 瑞昌市| 中江县| 浏阳市| 涟水县| 广饶县| 特克斯县| 成都市| 洮南市| 全州县| 元氏县| 白城市| 泽州县| 邮箱|