问题描述
简介
我正在使用引导程序框架.我目前正在研究引导程序选项卡"(隐藏/显示).我正在使用引导程序版本 3 和 jquery 版本 3.0.2.
I am working with the bootstrap framework.I am currently working on "Bootstrap Tabs"(hide/show).I am using bootstrap version 3 and jquery version 3.0.2 something.
问题
我的选项卡不起作用,除非我加载版本低于 1.6 的 jquery.但是 ajax 使 jquery 低于 1.6 出现问题.Chrome 控制台给我这个错误.
My tabs are not working, unless i load jquery of version less than 1.6.But then ajax making problem with jquery less than 1.6. Chrome console give me this error.
bootstrap.min.js:6 未捕获的错误:Bootstrap 的 JavaScript 需要jQuery 1.9.1 或更高版本,但低于版本 3
我尝试了不同的回退技术,但无法正确实施.
I tried different fallback techniques but couldn't implement correctly.
我在这里被困了 2 天,如果有人有任何想法或任何参考,请帮忙.感谢您的时间.
I am stuck here for 2 days, if someone have any idea or any reference, please do help.Thanks for your time.
推荐答案
目前 Bootstrap 3.x 不支持 jQuery 3.x,如此处报告:https://github.com/twbs/bootstrap/issues/16834
Currently Bootstrap 3.x does not support jQuery 3.x as reported here: https://github.com/twbs/bootstrap/issues/16834
问题是由以下原因引起的:
The issue is caused by:
jQuery 3 比 jQuery 2 更严格.它就像 XHTML 和 HTML.向后兼容性得以保留,代码看起来不会一团糟.如果我没记错的话,你需要做的就是替换 show() 和 hide()使用 .css('display', '') 或 addClass('hidden') 函数并修复一个alert.js 中的选择器(QUnit 在这一行失败,因为 $('#') 是在 jQuery 中无效 3)
它在 Bootstrap 3.3.7 版本中得到修复:https://github.com/twbs/bootstrap/issues/16834#issuecomment-225039913
It is fixed in the Bootstrap 3.3.7 release: https://github.com/twbs/bootstrap/issues/16834#issuecomment-225039913
这篇关于Bootstrap 的 JavaScript 需要 jQuery 1.9.1 或更高版本,但低于版本 3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!