$(...).modal is not a function

142 阅读1分钟

问题

控制台报错:modal is not a function

原因

springboot和jQuery的js文件引用顺序出错

<script type="text/javascript" src="js/bootstrap.js"></script>
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>

解决

jquery的js文件引用在前 因为bootstrap引用了jquery中的方法