最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Bootstrap javascript or popover not working - Stack Overflow

programmeradmin1浏览0评论

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. (/) 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=".js"></script>

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>
Share Improve this question edited Jan 10, 2013 at 15:09 Jeromy French 12.1k19 gold badges78 silver badges134 bronze badges asked Dec 17, 2012 at 22:27 user1911283user1911283 1111 gold badge2 silver badges8 bronze badges 4
  • 1 check console for errors, i'd be willing to bet there is one – Scott Selby Commented Dec 17, 2012 at 22:29
  • Seeing any errors in your console? – Mike Robinson Commented Dec 17, 2012 at 22:29
  • like what Mike said. Any errors in your console? You know what console is? – Chanckjh Commented Dec 17, 2012 at 22:34
  • y, I've just found out how to view the console for js – user1911283 Commented Dec 17, 2012 at 22:55
Add a comment  | 

1 Answer 1

Reset to default 15

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.

发布评论

评论列表(0)

  1. 暂无评论