<html>
<HEAD>
</HEAD>
<BODY>
<script language=javascript>
display();
var i=1;
function display()
{
i++;
document.write( " <html> <HEAD> </HEAD> <BODY> <p> "+document.body.clientWidth+ " </p> ");
document.writeln( " <p> "+document.body.clientHeight+ " </p> ");
document.writeln( " <p> "+document.body.scrollLeft+ " </p> ");
document.writeln( " <p> "+document.body.scrollTop+ " </p> ");
document.writeln( " <p> "+i+ " </p> </BODY> </html> ");
}
setTimeout( "display(); ",1000);
</script>
</BODY>
</html>
------解决方案--------------------
display();
var i=1;
优先级!
你那方法在变量声明前调用了...