未捕获的SyntaxError:意外的令牌

时间:2021-12-02 12:05:41

Here is the code of my index.html:

这是我的index.html的代码:

<html>
  <head>
    <meta charset="UTF-8" >
    <title>Index</title>
    <link rel="stylesheet" href="styles/main.css" />
    <link rel="stylesheet" ng-href="bower_components/bootstrap/dist/css/bootstrap.min.css" />
 </head>
 <body ng-app="app">


    <div ng-view></div>

    <script src="bower_components/angular/angular.min.js"></script>
    <script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
    <script src="bower_components/angular-route/angular-route.min.js"></script>
    <script src="bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js"></script>
    <script src="scripts/angular/app.js"></script>
    <script src="scripts/angular/controllers.js"></script>
 </body>
</html>

However, it shows the error in return:

但是,它显示了错误的回报:

bootstrap.min.js:1 Uncaught SyntaxError: Unexpected token <

bootstrap.min.js:1未捕获的SyntaxError:意外的令牌<

ui-bootstrap-tpls.min.js:1 Uncaught SyntaxError: Unexpected token <

ui-bootstrap-tpls.min.js:1未捕获的SyntaxError:意外的令牌<

bootstrap_error

bootstrap_error

Is it the problem of my code or bootstrap? I found the error exists when I add

这是我的代码或引导程序的问题?我添加时发现错误存在

<script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script> 

and

<script src="bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js"></script> 

into the index.html. Anyone knows the cause of the error? Thanks :)

进入index.html。有谁知道错误的原因?谢谢 :)

2 个解决方案

#1


2  

Its definitely a problem with the bootstrap file. The line 1 contains '<'.

它肯定是bootstrap文件的问题。第1行包含'<'。

Try manually opening the files and removing it.

尝试手动打开文件并将其删除。

#2


0  

I was getting the same issue with the ASP.Net. All I had to do is to clean the solution and rebuild it.

我在ASP.Net上遇到了同样的问题。我所要做的就是清理解决方案并重建它。

#1


2  

Its definitely a problem with the bootstrap file. The line 1 contains '<'.

它肯定是bootstrap文件的问题。第1行包含'<'。

Try manually opening the files and removing it.

尝试手动打开文件并将其删除。

#2


0  

I was getting the same issue with the ASP.Net. All I had to do is to clean the solution and rebuild it.

我在ASP.Net上遇到了同样的问题。我所要做的就是清理解决方案并重建它。