Twitter Bootstrap 是否包含 jQuery?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11526594/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 10:42:14  来源:igfitidea点击:

Does Twitter Bootstrap include jQuery?

jquerytwitter-bootstrap

提问by Matt K

Does Twitter Bootstrapv3 include jQueryor 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?

Twitter Bootstrapv3是否包含jQuery或者我是否需要单独包含 jQuery?如果确实包含 jQuery,那么包含什么版本(数量)的 jQuery,使用 Bootstrap 时所有 jQuery 函数都可用吗?

采纳答案by Manse

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

当心!所有 javascript 插件都需要最新版本的 jQuery。

Right here in the docs

就在文档中

Here is the current release link for jQuery

这是 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)

Bootstrap“产品”有许多元素——其中之一是 JavaScript 插件——只有这些需要 jQuery——它们扩展了 jQuery 功能,所以是的,所有 jQuery 方法/函数都可用。其余(CSS、脚手架、组件等)需要 HTML 和 CSS(或组合)

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

jQuery 不包含在 Twitter Bootstrap 下载中 - 您必须下载它/链接到它的 CDN 版本

EDIT:

编辑:

2.X requires atleast 1.7

回答by Terry

Does Twitter Bootstrap use jQuery?

Twitter Bootstrap 使用 jQuery 吗?

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

是的,jQuery 插件需要 jQuery。正如迈克指出的那样,网站上清楚地提到了这一点。

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

如果是这样,使用的是什么版本(编号)的 jQuery

Also as Mike mentioned, latest version

同样正如迈克提到的,最新版本

are all jQuery functions available?

所有 jQuery 函数都可用吗?

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.

jQuery 函数可通过 jQuery 获得,它们与 Bootstrap 无关。如果包含 jQuery 库,则可以使用任何所需的 jQuery 功能。

回答by sachleen

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.

Bootstrap jQuery 插件就像任何其他 jQuery 插件一样,因为它们需要 jQuery 才能工作。您下载 jQuery 并将其包含在您的页面中,然后包含 Boostrap 插件。

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

它不使用特定版本的 jQuery,只需从jQuery 站点获取最新版本。

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

所有 jQuery 函数都可以在 jQuery 中使用(还有什么?),Bootstrap 与它无关......它只是给你一些额外的插件。