<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>New Page 1</title>
</head><body>
<span style="background-color:red" id=aaa ></span>
<br><input type=button value=test onclick="testFun();">
</body></html>
<script>
function testFun()
{
var tempValue=0;
for(var i=0;i<10000;i++)
{
tempValue+=i;
aaa.style.width=(i/100)+"%";
if((i%100)==0)
window.showModalDialog("about:"+(i/100)+"%"+"<script>window.setTimeout('window.close()',10)<\/sc"+"ript>","","dialogHeight:100px;dialogWidth:100px;");}
}</script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>New Page 1</title>
</head><body>
<span style="background-color:red" id=aaa ></span>
<br><input type=button value=test onclick="testFun();">
</body></html>
<script>
function testFun()
{
var tempValue=0;
for(var i=0;i<10000;i++)
{
tempValue+=i;
aaa.style.width=(i/100)+"%";
if((i%100)==0)
window.showModalDialog("about:"+(i/100)+"%"+"<script>window.setTimeout('window.close()',10)<\/sc"+"ript>","","dialogHeight:100px;dialogWidth:100px;");}
}</script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>New Page 1</title>
</head><body>
<span style="background-color:red" id=aaa ></span>
<br><input type=button value=test onclick="testFun();">
</body></html>
<script>
function testFun()
{
var tempValue=0;
for(var i=0;i<10000;i++)
{
tempValue+=i;
aaa.style.width=(i/100)+"%";
if((i%100)==0)
window.showModalDialog("a1.html?"+(i/100),"","dialogHeight:100px;dialogWidth:100px;");}
}</script>------
a1.html:
<html>
<script language=javascript>
window.setTimeout("window.close();",10);
</script>
</html>
查过MSDN,好像我的想法不可能,浏览器必定是"循环更改,一次显示".