我一直在这个论坛上阅读此错误,但没有找到任何有帮助的内容。真正奇怪的是,我在一次讲座中从我的老师那里复制了这个,但它不会通过 .有什么想法吗?
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Warner: iLab 1 Iteration and Summing Numbers</title>
</head>
<body style="font: 100% Ariel;">
<h2>Iteration |Summing Numbers Between Two Integers |</h2><hr />
<p>
<script type="text/javascript">
var firstInt = parseInt(prompt("Enter an Integer from 1 and 4",""));
document.write("Your first Entry: " +firstInt);
var secondInt = parseInt(prompt("Enter an Integer from 6 and 9",""));
document.write("<br> Your second Entry: "+secondInt+"<br>);
var sumNumbers = 0;
for(var i=firstInt; i<=secondInt; i++)
{
sumNumbers += i;
}
document.write("<br>The answer is "+ sumNumbers);
</script>
</p>
</body>
</html>
最佳答案
您缺少右引号:
document.write("<br> Your second Entry: "+secondInt+"<br>);
关于javascript - 未捕获的语法错误 : Unexpected token ILLEGAL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24624843/