Bootstrap 的 JavaScript 需要 jQuery 1.9.1 或更高版本
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/29170799/
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
Bootstrap's JavaScript requires jQuery version 1.9.1 or higher
提问by Geo
I have all necessary files in my code and I am still getting this error:
我的代码中有所有必需的文件,但仍然出现此错误:
Bootstrap's JavaScript requires jQuery version 1.9.1 or higher
Bootstrap 的 JavaScript 需要 jQuery 1.9.1 或更高版本
This is my code:
这是我的代码:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src='//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js'></script>
<script src="js/jquery.responsiveiframe.js"></script>
<script src="js/ios-orientationchange-fix.js"></script>
Anyone got this error before? I could try and download a local copy instead of using the CDN link but it's really unnecessary, plus i want to know why this isn't working!
以前有人遇到过这个错误吗?我可以尝试下载本地副本而不是使用 CDN 链接,但这真的没有必要,而且我想知道为什么这不起作用!
EDIT: I've tried many different libraries, the one I posted is the last one I've tried
编辑:我尝试了许多不同的库,我发布的库是我尝试过的最后一个


回答by Mike Robinson
Type $.fn.jqueryin your consoleand tell us what numbers it says. You probably have a second version running somewhere.
键入$.fn.jquery在您的控制台,并告诉我们它说什么数字。您可能在某处运行了第二个版本。
回答by Md Mazedul Islam Khan
Bootstrap v3.3.6 isn't compatible with the jQuery 3.0. This will be fixed in the upcoming Bootstrap version 3.3.7. Here's the issue currently open on GitHub. https://github.com/twbs/bootstrap/issues/16834
Bootstrap v3.3.6 与 jQuery 3.0 不兼容。这将在即将发布的 Bootstrap 版本 3.3.7 中修复。这是目前在 GitHub 上打开的问题。https://github.com/twbs/bootstrap/issues/16834
回答by Prashanth Benny
In my case(Bootstrap) the issue was, having the JQuery 3.0.0 which is also not fine, So using a version which is an earlier version like 2.2.4.
在我的情况下(Bootstrap),问题是,JQuery 3.0.0 也不好,所以使用早期版本,如 2.2.4。
The Error i got was: Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3
我得到的错误是:Bootstrap 的 JavaScript 需要 jQuery 1.9.1 或更高版本,但低于版本 3
Using any of these CDN below as the source would help if this is the case!
如果是这种情况,使用下面的任何这些 CDN 作为源都会有所帮助!
jQuery version 2.2.4:
jQuery 2.2.4 版:
http://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.2.4.js
http://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.2.4.js
http://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.2.4.min.js
http://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.2.4.min.js
Hope this helped at least someone!.. :)
希望这至少对某人有所帮助!.. :)
Thank you!
谢谢!
回答by user3746971
You can use Bootstrap 3.3.7. Update your CDN links to this
您可以使用 Bootstrap 3.3.7。将您的 CDN 链接更新到此
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<!-- Latest compiled and minified JavaScript -->
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
回答by rhymn
For Meteor, this can be solved by changing twbs:[email protected] to twbs:[email protected] in .versions
对于 Meteor,这可以通过将 .versions 中的 twbs:[email protected] 更改为 twbs:[email protected] 来解决
回答by Catarino
in my case the fix was replacing
在我的情况下,修复正在替换
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
with
和
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
回答by dzona
Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3
Bootstrap 的 JavaScript 需要 jQuery 1.9.1 或更高版本,但低于版本 3
This is probably issue with jQuery 3.x conflicting Bootstrap 3.x Issue has been fixed with Bootstrap version 3.3.7
这可能是 jQuery 3.x 与 Bootstrap 3.x 冲突的问题Bootstrap 3.3.7 版已修复问题
回答by Fusion
If you are using CMS like Drupal or Wordpress - just install jQuery Update module and error no longer persists.
如果您使用的是 Drupal 或 Wordpress 之类的 CMS - 只需安装 jQuery 更新模块,错误将不再存在。
回答by Fuad Ak
Use this script, it is previous version of jquery. Solved my problem.
使用这个脚本,它是以前版本的jquery。解决了我的问题。
<script
src="https://code.jquery.com/jquery-2.2.4.min.js"
integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44="
crossorigin="anonymous"></script>
回答by Rhoderunner
While this is an old post, it is something that helped me solve the issue. So to keep others stumbling upon this to find a solution using the current Angular2 stack (2.0.0-rc.4 at this time), I downgraded my jQuery version to 2.2.4, added the bootstrap.js distributed under node_modules/bootstrap/dist/js to my InjectableDependencies (using gulp, and defining this in the project.config.ts file) and everything continues to work just fine.
虽然这是一篇旧帖子,但它帮助我解决了这个问题。因此,为了让其他人绊倒这个以找到使用当前 Angular2 堆栈(此时为 2.0.0-rc.4)的解决方案,我将我的 jQuery 版本降级到 2.2.4,添加了分布在 node_modules/bootstrap/ 下的 bootstrap.js dist/js 到我的 InjectableDependencies(使用 gulp,并在 project.config.ts 文件中定义它)并且一切继续正常工作。

