最近写jsp页面,使用了bootstrap,然后在引进bootstrap.js时报错:
Uncaught Error: Bootstrap's JavaScript requires jQuery bootstrap.js:8 at bootstrap.js:8
部分jsp文件:
<head>
<title>高效ToDo</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../js/bootstrap-3.3.7/dist/css/bootstrap.css">
<script src="../js/bootstrap-3.3.7/dist/js/bootstrap.js"></script>
<script src="../js/jquery/jquery-3.2.1.js"></script>
</head>
解决方案: 在引进jQuery文件时,需要放在bootstrap前面,即:
<head>
<title>高效ToDo</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../js/bootstrap-3.3.7/dist/css/bootstrap.css">
<script src="../js/jquery/jquery-3.2.1.js"></script>
<script src="../js/bootstrap-3.3.7/dist/js/bootstrap.js"></script>
</head>
更多推荐
关于错误:Uncaught Error: Bootstrap's JavaScript requires jQuery bootstrap.js:8
发布评论