while(something)
{
setTimeout(function()
{
var btn = document.createElement("P");
var t = document.createTextNode(str); //str->string variable
\t btn.appendChild(t);
document.body.appendChild(btn);
\t },1000);
}
我的程序应该是每一个时间的延迟后,立即写出来的str变量,但它只是在最后写出来。 任何解决方案,使其即时?
这就是设置超时一样。 – Manu
你确实知道这段代码在做什么? –
如果你想立即删除setTimeout .... – Manu