Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Twitter Bootstrap 2 javascript plugins not working

Firebug is throwing these errors:

$(document).on is not a function | bootstrap.js (line 786):

$(document).on('keyup.dismiss.modal', function ( e ) {

$("body").on is not a function | bootstrap.js (line 139):

$('body').on('click.alert.data-api', dismiss, Alert.prototype.close)

And then the plugins don't work.

Any ideas on how to fix this?

I'm loading jquery before bootstrap of course, so I don't know what's the problem. Jquery is working fine.

like image 325
HappyDeveloper Avatar asked Feb 05 '12 21:02

HappyDeveloper


People also ask

Can I use Bootstrap with JavaScript?

All Bootstrap's JavaScript files depend on util. js and it has to be included alongside the other JavaScript files. If you're using the compiled (or minified) bootstrap. js , there is no need to include this—it's already there.

Is Bootstrap still use jQuery?

It's possible! Bootstrap 5 is designed to be used without jQuery, but it's still possible to use our components with jQuery.

How do I use Bootstrap plugins?

To get started with the Bootstrap's JavaScript plugins, you don't need to be an advanced JavaScript developer. By utilizing Bootstrap Data API, most of the plugins can be triggered without writing a single line of code. Individually − Using Bootstrap's individual *. js files.

Does twitter use Bootstrap?

Closed 10 years ago. I took a look at the Twitter CSS and it's completely diferent from the Twitter Bootstrap CSS. It doesn't use Bootstrap's grid system, and it isn't responsive.


2 Answers

Nevermind, I was using a different version of jQuery. Downloaded the latest version and it worked fine.

like image 98
HappyDeveloper Avatar answered Oct 20 '22 00:10

HappyDeveloper


The .on() was added in jQuery version 1.7, and supercedes delegate() and live().

like image 34
ustun Avatar answered Oct 20 '22 00:10

ustun