老師幫忙看看哪里寫錯(cuò)了
<html>
<head>
<title>javascript?實(shí)驗(yàn)</title>
<script?type="text/javascript">
var?num=10;
??while(num>8){
??document.write("數(shù)字"+num+"<br/>")
??num++;??
??}
</script>
</head>
<body>
</body>
</html>沒反應(yīng)啊
<html>
<head>
<title>javascript?實(shí)驗(yàn)</title>
<script?type="text/javascript">
var?num=10;
??while(num>8){
??document.write("數(shù)字"+num+"<br/>")
??num++;??
??}
</script>
</head>
<body>
</body>
</html>沒反應(yīng)啊
2015-04-02
舉報(bào)
2015-04-04
定義了num=10;而判斷條件是num>8就執(zhí)行,因此這個(gè)條件恒成立,會(huì)無限循環(huán)的執(zhí)行下去!
切記:寫循環(huán)不能寫死循環(huán)。
2015-04-02
死循環(huán)啊。。。