twitter-bootstrap Bootstrap 3.3.6 和 JQuery 3.1.0 不兼容?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/38434141/
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 3.3.6 and JQuery 3.1.0 not compatible?
提问by Parthannun
Is it possible that these 2 (both are newest versions) aren't compatible? (In the snippets: The local files are the newest versions, the online retrieved files are older versions) Is there anything I can do to use both locally?
这两个(都是最新版本)是否可能不兼容?(在片段中:本地文件是最新版本,在线检索的文件是旧版本)我可以做些什么来在本地使用它们?
These snippets work:
这些片段有效:
Snippet 1:
片段 1:
<script src="js/jquery-3.1.0.min.js"></script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
Snippet 2:
片段 2:
<script src="https://code.jquery.com/jquery-2.2.3.min.js"></script>
<script src="js/bootstrap.min.js"></script>
This snippet doesn't work:
此代码段不起作用:
<script src="js/jquery-3.1.0.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
I've tried them with this dropdown menu:
我已经用这个下拉菜单试过了:
<nav class="nav navbar-inverse">
<ul class="nav navbar-nav">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Info<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="html/bussen.html">Bussen</a></li>
<li><a href="html/DJs.html">DJ's</a></li>
</ul>
</li>
</ul>
</nav>
回答by MD Ashik
Right Now Bootstrap 3.3.7are Updated and jquery jquery-3.1.1are well working for me. Not showing a single error in my console or anywhere. So I think you can use updated bootstrap.
现在Bootstrap 3.3.7已更新,jquery jquery-3.1.1对我来说很好用。在我的控制台或任何地方都没有显示一个错误。所以我认为你可以使用更新的引导程序。
Bootstrap say to set JQuery version to 1.9.0or higherLink
Bootstrap 说将 JQuery 版本设置为1.9.0或更高链接
Bootstrap 3.3.7 support jQuery version 3 and above
Bootstrap 3.3.7 支持 jQuery 3 及以上版本
Get more information in Github Issue Link
在 Github 问题链接中获取更多信息
回答by jakob
Bootstrap 3 is not compatible with jQuery 3.0 and above at the moment. So latest version of jQuery that can be used with Bootstrap 3 is 2.2.4.
Bootstrap 3 目前与 jQuery 3.0 及更高版本不兼容。所以可以与 Bootstrap 3 一起使用的 jQuery 的最新版本是 2.2.4。
Although, somereported that it works with jQuery Migrate.
虽然,有些人报告说它可以与 jQuery Migrate 一起使用。
You can check this discussionfor more info.
您可以查看此讨论以获取更多信息。
Update
更新
Like MD Ashik reported, latest Bootstrap versions work well with jQuery 3+
就像 MD Ashik 报道的那样,最新的 Bootstrap 版本可以很好地与 jQuery 3+ 配合使用
回答by Nguyen Manh Tung
Because jQuery 3.0 is still in alpha test, so it needs time to compatible with Bootstrap 3. Y
因为 jQuery 3.0 还在 alpha 测试中,所以它需要时间来兼容 Bootstrap 3。是

