帝王谷资源网 Design By www.wdxyy.com
<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.
//<![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.
帝王谷资源网 Design By www.wdxyy.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
帝王谷资源网 Design By www.wdxyy.com
暂无评论...
更新日志
2024年11月01日
2024年11月01日
- 苏曼《好久不见》头版限量编号蓝光MQA[低速原抓WAV+CUE]
- 王家卫《繁花》电影原声3CD[低速原抓WAV+CUE]
- 群星《红色经典》限量1:1母盘直刻[低速原抓WAV+CUE]
- 苗子杰.1993-SUN.SHINE【歌林】【WAV+CUE】
- 吕方.1990-不舍得你【华纳】【WAV+CUE】
- 刘若英.2005-一整夜【大熊星】【WAV+CUE】
- 刘锐/王星《牧者影视配乐精选·贰》[FLAC/分轨][271.13MB]
- 林一峰《作业》[320K/MP3][185.25MB]
- 林一峰《作业》[FLAC/分轨][511.47MB]
- 魔兽世界永久60级奶骑天赋怎么点 永久60级奶骑天赋推荐
- 魔兽世界永久60级矮人牧师怎么玩 永久60级矮人牧师玩法指南
- 炉石传说40血卡组代码一览 2024最新全职业40血卡组代码大全
- 《如龙:极》NS实体版确认!35美元 25年3月发货
- 日本离谱忍者游戏将登NS:手柄插进屁股进行对决
- 《神之天平外传》NS版今日发售 可独立于本体运行