在写bootstarp的时候,一直报
Uncaught Error: Bootstrap's JavaScript requires jQuery
查看了自己引入的文件路径是对的,也可以使用jquery进行操作表单
<script src="node_modules/jquery/dist/cdn/jquery-2.1.1.min.js"> </script> <link rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap.min.css"/> <script src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
之后导入菜鸟的链接
<script src="https://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script> <script src="node_modules/jquery/dist/cdn/jquery-2.1.1.min.js"> </script> <link rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap.min.css"/>
<!--<script src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
完全可以使用的。boostrap下拉菜单起作用。后来翻看了一下,说:
js文件引入的先后顺序,应该先引入jquery的js文件再引入bootstrap的css文件。