初学问题
function test(){for(var i=0; i<3; i++){
document.write(i+"<br>");
document.body.onclick=function(){
document.write(i);
}
}
}
为什么document.write(i+"<br>");循环完才往下运行? 谢谢解答!
2009-12-31 10:26
document.body.onclick被重写了
2009-12-31 10:39
程序代码:(function test(){
for(var i=0; i<3; i++){
document.write(i+"<br />");
(function(){
alert(i);
})()
}
})()试试这个
2009-12-31 10:45
2009-12-31 10:45
2009-12-31 11:01
2009-12-31 14:52
2010-01-13 19:01
2010-01-13 19:20