//functionfstatus(){
for(vari=0;i<100000;i++){
window.status="nowprocessis""+i+""";
}
}
functionfinnerHtml(){
for(vari=0;i<1000;i++){
document.getElementById("demo").innerHTML="nowprocessis""+i+""";
}
}
//]]>
However,thewindow.statusinrealtimethatperfectdisplaytheloopdigit,buttheinnerHTMLpropertyisnot.
Justdisplayresultdigit:nowprocessis"999".
AndhowtousinginnerHTMLdisplayrealtimedata?canbutusewindow.setTimeout,orwindow.setIntervalmethod,likethis:
varcnt=0;
functionfinnerHtml(){
if(cnt++>=1000)return;
document.getElementById("demo").innerText="nowprocessis""+cnt+""";
window.setTimeout(finnerHtml,10)
}
But,it'snoconvenient.thedisplayspeedisnotwell,andwemustcontrolsomething.
e.g.
setTimeoutvariables,whenitcompletely.
So,Iproposewinodw.statustoreplaceinnerHTMLpropertywhendisplayinrealtime.