Bootstrap: 'TypeError undefined is not a function'/'has no method 'tab'' when using bootstrap-tabs Bootstrap: 'TypeError undefined is not a function'/'has no method 'tab'' when using bootstrap-tabs ruby-on-rails ruby-on-rails

Bootstrap: 'TypeError undefined is not a function'/'has no method 'tab'' when using bootstrap-tabs


This can also be caused if you include bootstrap.js before jquery.js.

Others might have the same problem I did.

Include jQuery before bootstrap.


I actually managed to work out what I was doing wrong (and it was my fault).

I'm used to using pre-jQuery Rails, so when I included the Bootstrap JS files I didn't think that including the version of jQuery bundled with them would cause any issues, however when I removed that one JS file everything started working perfectly.

Lesson learnt, triple check which JS files are loaded, see if there's any conflicts.


make sure you're using the newest jquery, and problem solved

I met this problem with this code:

<script src="/scripts/plugins/jquery/jquery-1.6.2.min.js"> </script><script src="/scripts/plugins/bootstrap/js/bootstrap.js"></script>

After change it to this:

<script src="/scripts/plugins/jquery/jquery-1.7.2.min.js"> </script><script src="/scripts/plugins/bootstrap/js/bootstrap.js"></script>

It works fine