所以这是我要运行的脚本:
<head>
<meta http-equiv="content-type" content="text/xml;
charset=utf-8" />
<title>rollDie.html</title>
<script type = "text/javascript">
//<![CDATA[
// DiceRomanNumbers
var die = Math.ceil(Math.random() * 6);
var output = "";
switch(die){
case 1:
output = "I";
break;
case 2:
output = "II";
break;
case 3:
output = "III";
break;
case 4:
output = "IV";
break;
case 5:
output = "V";
break;
case 6:
output = "VI";
break;
default:
output = "PROBLEM!!!";
} // end switch
</script>
</head>
</html>
但是,当我运行它时,什么也没有出现。应该出现的是一个带有罗马数字 1-6 的对话框。谁能指出错误?我一直在强调为什么它现在不能运行一个小时。