【发布时间】:2020-11-15 15:28:09
【问题描述】:
您好,我有一个带有这个 html 的电子应用程序:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
<!-- jQuery -->
<script src="./static/jquery/jquery-3.5.1.min.js"></script>
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="./static/bootstrap/css/bootstrap.min.css" />
<!-- Bootstrap JS -->
<script src="./static/bootstrap/js/bootstrap.min.js"></script>
<!-- font awesome -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<style>
/* expand/collapse card style */
.card-header .fa {
transition: .3s transform ease-in-out;
}
.card-header .collapsed .fa {
transform: rotate(90deg);
}
</style>
<body>
<div class="card">
<h5 class="card-header">
<a data-toggle="collapse" href="#collapse-example" aria-expanded="true" aria-controls="collapse-example" id="heading-example" class="d-block">
<i class="fa fa-chevron-down pull-right"></i>
Collapsible Group Item #1
</a>
</h5>
<div id="collapse-example" class="collapse show" aria-labelledby="heading-example">
<div class="card-body">
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon
officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3
wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et.
Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan
excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt
you probably haven't heard of them accusamus labore sustainable VHS.
</div>
</div>
</div>
<strong>Upload Queue:</strong>
<div id="uploadList">
</div>
<br><br>
<h3>Drag and Drop Files in the Window.</h3>
<!-- Adding Individual Renderer Process JS File -->
<script src="index.js"></script>
</body>
</html>
你可以看到我首先包含 jquery,然后是 bootstrap 和 font awesome。但是当我运行它时,我在控制台中收到错误:
util.js:179 Uncaught TypeError: Bootstrap's JavaScript requires jQuery. jQuery must be included before Bootstrap's JavaScript.
at Object.jQueryDetection (util.js:179)
at util.js:195
at bootstrap.min.js:6
at bootstrap.min.js:6
我的 jquery 显然在 bootstrap 之前,有什么用?我试图让我所有的依赖项都是本地文件而不是库。
【问题讨论】:
-
只需将 放在
标签: javascript html jquery electron