我不知道爲什麼這樣做,雖然代碼不能重複問問題...並且在我把這些做的同時......根本沒有功能......JavaScript初學者:做循環重複
<script type='text/javascript'>
var done;
do{
var num = prompt("Enter Number", "0") //prompt user to enter the number
number = parseInt(num); //parse the num to number
var i;
document.write('<table border="1" cellspacing="0">');
for(i=1;i<=12;i++)
{
document.write("<tr><td>" + i + " x " + number + " = " + number*i + "</td></tr>");
}
document.write("</table>");
}while(window.confirm("Do you want to enter another number to show another multiplication table?")
</script>
他的意思是他把在一段時間後,該腳本完全停止工作。 – elzapp 2014-11-04 09:28:08