Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3

后端 未结 7 753
有刺的猬
有刺的猬 2020-11-30 08:43

Introduction

I am working with the bootstrap framework.I am currently working on \"Bootstrap Tabs\"(hide/show).I am using bootstrap version 3 and jq

相关标签:
7条回答
  • 2020-11-30 09:29

    What solved my problem is actually loading jquery lower version before bootstrap.js and then loading jquery higher version after bootstrap.js to resolve conflicts.Above is my example

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    <script src="~/App_Theme/bootstrap/js/bootstrap.min.js"></script>
    <script>
        var $j = jQuery.noConflict();
    </script>
    
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/3.0.0/jquery.min.js"></script>
    <script>
        var $ = jQuery.noConflict();
    </script>
    
    0 讨论(0)
  • 2020-11-30 09:30

    I had same problem and I have not jquery 1.8.2 in my web pages.I solve my problem by change version of jquery in packages.config

    change

      <package id="AspNet.ScriptManager.jQuery" version="1.8.2" targetFramework="net45" />
     <package id="jQuery" version="1.8.2" targetFramework="net45" />
    

    to

    <package id="AspNet.ScriptManager.jQuery" version="2.1.4" targetFramework="net45" />
     <package id="jQuery" version="2.1.4" targetFramework="net45" />
    

    my jquery version is 2.1.4

    0 讨论(0)
  • 2020-11-30 09:31

    As for me, everything simple. It's all about queue links files. I need to move links like this:

    <head>
         <script src="js/jquery1.9.1.js"></script>
         <script src="js/bootstrap.js"> </script>       
    </head>
    

    After all - it's working prorerly.

    0 讨论(0)
  • 2020-11-30 09:32

    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 is more strict than jQuery 2. It's like XHTML and HTML. Backward compatibility is preserved and code doesn't look like a mess. If I'm not mistaken, all you need to do is replace show() and hide() functions with .css('display', '') or addClass('hidden') and fix a selector in alert.js (QUnit fails on this line because $('#') is invalid in jQuery 3)

    It is fixed in the Bootstrap 3.3.7 release: https://github.com/twbs/bootstrap/issues/16834#issuecomment-225039913

    0 讨论(0)
  • 2020-11-30 09:32

    Latest current version of Bootstrap (3.3.7) now supports jQuery 3+, as per developer's comment here https://github.com/twbs/bootstrap/issues/16834.

    0 讨论(0)
  • 2020-11-30 09:37

    So I had the new version of Bootstrap but for some reason the min version was still the old version which did not support the JQuery 3. I removed the minified bootstrap JS then reminified the new Bootstrap.js and deployed and the problem went away.

    0 讨论(0)
提交回复
热议问题