Bootstrap javascript or popover not working

馋奶兔 提交于 2019-12-17 19:49:52

问题


Got a Problem with my Bootstrap. It seems as if the JS is not working correctly somehow, because even the easiest examples of popovers dont work. (http://jsfiddle.net/weuWk/363/) This little piece of code which works correctly on JSFiddle, is just creating a Button(w/o hover functionality) if used in my source code.

The Modal-Plugin is actually working, so this should mean that i include the js files in the right way. I will copy it anyway:

 <script src="js/bootstrap.min.js"></script>
 <script src="http://code.jquery.com/jquery-latest.js"></script>

回答1:


jQuery needs to be included before bootstrap's javascript, as bootstrap is just jQuery "plugins".

You should Include in this order:

  1. jQuery
  2. Bootstrap
  3. Your Javascript

EDIT: Try this right before the closing body tag

<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="js/bootstrap.min.js"></script>
<script> 
$(function(){
    $('#test').popover();​
});
 </script>

Also, the console is your friend. Check and make sure there are no errors.

SOLVED:

Solution: > Right order of Includes > fixing errors i got from my js console.



来源:https://stackoverflow.com/questions/13923297/bootstrap-javascript-or-popover-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!