javascript - 未捕获的语法错误 : Unexpected token ILLEGAL

标签 javascript syntax-error token

我一直在这个论坛上阅读此错误,但没有找到任何有帮助的内容。真正奇怪的是,我在一次讲座中从我的老师那里复制了这个,但它不会通过 .有什么想法吗?

<!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/

相关文章:

php - 在 PHP 中使用 Javascript 变量

javascript - 单击浏览器后退按钮关闭 $mdDialog - AngularJS

javascript - Angular -TS-错误 TS1109 : Expression Expected

javascript - AjaxSetup 与 jqgrid 冲突

sql - 每N条记录的返回行

C++ 奇怪的编译器语法错误

php - Uncaught SyntaxError : Unexpected token }

proxy - 使用 RBAC 访问 kubernetes 仪表板所需的用户权限

elasticsearch - 如何在 ElasticSearch 中不分析?

c - C中的嵌套strtok函数问题