Does Twitter Bootstrap include jQuery?
Asked Answered
C

3

75

Does Twitter Bootstrap v3 include jQuery or do I need to include jQuery separately? If it does include jQuery, what version (number) of jQuery is included, and are all jQuery functions available when using Bootstrap?

Clatter answered 17/7, 2012 at 16:12 Comment(7)
I don't see a version number for jQuery on their website.. Also it says "With Bootstrap, you get custom-built jQuery plugins to bring your projects to life." That doesn't answer my question.Clatter
"Heads up! All javascript plugins require the latest version of jQuery."Thrall
What do you mean by "are all jQuery functions available"?Homeo
I've updated my question to be more specific. I was curious about whether or not I needed to include jQuery separately when using Bootstrap.Clatter
@MatthewKeefe updated my answer ... no its not included - its a set of plugins .. just like any other plugin you find on the web ...Rorry
@ManseUK Thanks! It wasn't clear to me from their documentation, but it makes sense now.Clatter
The Bootstrap 2.3 release announcement says "Upgraded to jQuery 1.9. No changes were needed, but we did upgrade the included jQuery file to the latest release.", but this is misleading. jQuery is not included in the bootstrap.js file.Grapeshot
R
55

Heads up! All javascript plugins require the latest version of jQuery.

Right here in the docs

Here is the current release link for jQuery

There are a number of elements to the Bootstrap "product" - one of them are JavaScript Plugins - only these require jQuery - and they extend the jQuery functionality so yes all jQuery methods / functions are available. The remainder (CSS, Scaffolding, Components etc) require HTML and CSS (or a combination)

jQuery is not included within the Twitter Bootstrap download - you must download it / link to a CDN version of it

EDIT:

2.X requires atleast 1.7
Rorry answered 17/7, 2012 at 16:16 Comment(4)
This answer is for Bootstrap 2, which hasn't been supported for a while. Bootstrap 3 also requires all jQuery plugins.. However, the question is, does Bootstrap include jQuery? And the answer is yes - one can look in [bootstrap.min.js](wget maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js), which starts with if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery").Chladek
I think the comment by @DanDascalescu is wrong. The answer is still no, it's not included, right!? If you look at the code, bootstrap throws an error if jQuery is not found, but it does not include it.Phytology
The link above to Bootstrap's docs actually says "Consult our bower.json to see which versions of jQuery are supported." At this moment, the bower.json says "jquery": "1.9.1 - 3" That's quite a wide range of jQuery that's supported. So, it doesn't seem accurate to say "All javascript plugins require the latest version of jQuery."Raspy
the first link does not work anymore. The docs can be misunderstood here, I think that pure bootstrap 5 works without jquery, but the plugins/components? like bootstrap-select still need it.Desai
K
30

Does Twitter Bootstrap use jQuery?

Yes, jQuery plugins require jQuery. And as Mike pointed out, it is clearly mentioned on the site.

If so, what version (number) of jQuery is used

Also as Mike mentioned, latest version

are all jQuery functions available?

jQuery functions are available through jQuery, they have nothing to do with Bootstrap. If you include the jQuery library, you can use any jQuery functionality you want.

Kev answered 17/7, 2012 at 16:19 Comment(0)
U
6

The Bootstrap jQuery plugins are just like any other jQuery plugins in that they require jQuery to work. You download jQuery and include it in your page, and then include the Boostrap plugins.

It doesn't use a specific version of jQuery, just get the latest version from the jQuery site.

All jQuery functions are available in jQuery (how else?), Bootstrap has nothing to do with it... it just gives you some extra plugins.

Urdu answered 17/7, 2012 at 16:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.