繁体   English   中英

未捕获的错误引导程序需要 bootstrap.min.js 中的 jquery

[英]uncaught error bootstrap requires jquery at bootstrap.min.js

即使在引导之前已加载所有 jquery 并且还使用了 1.9.1 版本,我也会收到此错误

尝试使用 jquery 版本 1.9.1 并且它仍然可以解决

 <script type="text/javascript" src="js/jquery-1.9.1.js"></script>


     <link href="css/jquery-ui.css" rel="stylesheet" />
    <script src="https://www.bootstrap-year-calendar.com/js/jquery-1.10.2.min.js" type="text/javascript"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js" type="text/javascript"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js" type="text/javascript"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular-animate.min.js" type="text/javascript"></script>


    <link rel="stylesheet" href="css/bootstrap.min.css" />
    <link rel="stylesheet" href="css/style.css" />
    <link rel="stylesheet" href="css/bootstrap-theme.css" />
    <link rel="stylesheet" href="css/bootstrap-theme.min.css" />
    <link rel="stylesheet" href="css/bootstrap.css" />

    <script src="js/bootstrap.js" type="text/javascript"></script>
    <script src="js/bootstrap.min.js" type="text/javascript"></script>


    <script src="https://www.bootstrap-year-calendar.com/js/respond.min.js" type="text/javascript"></script>



    <script src="https://www.bootstrap-year-calendar.com/js/bootstrap-datepicker.min.js" type="text/javascript"></script>
    <script src="https://www.bootstrap-year-calendar.com/js/bootstrap-year-calendar.min.js" type="text/javascript"></script>
    <script src="https://www.bootstrap-year-calendar.com/js/bootstrap-popover.js" type="text/javascript"></script>
    <script src="https://www.bootstrap-year-calendar.com/js/scripts.js" type="text/javascript"></script>

    <link rel="stylesheet" type="text/css" href="css/cal/bootstrap-datepicker.min.css">
    <link rel="stylesheet" type="text/css" href="css/cal/bootstrap-theme.min.css">
    <link rel="stylesheet" type="text/css" href="css/cal/bootstrap-year-calendar.min.css">

我之前在引用 jquery 或 Bootstrap 的两个不同版本时遇到过这个问题,你在这里都做了。 您在此代码中有三个版本的 JQuery:

<script type="text/javascript" src="js/jquery-1.9.1.js"></script>
<script src="https://www.bootstrap-year-calendar.com/js/jquery-1.10.2.min.js" type="text/javascript"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js" type="text/javascript"></script>

您还加载了 bootstrap 和 bootstrap min js 文件,它们会相互干扰。

尝试简化您的代码,并且只使用每个库/框架的 1 个版本。

所以在引导程序之前加载了一个版本的 JQuery。 一个版本的引导程序。 所以确保你有你的 JQuery 脚本 src 然后是你的引导程序。

如果您尝试添加多个版本的引导程序,则会出现此错误。 引导程序和 jquery 的顺序也很重要。 尝试包括这个

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>

尝试包括这个

<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM