Uncaught Error: Bootstrap's JavaScript requires jQuery


在写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文件。

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM