jQuery is not defined twitter bootstrap

前端 未结 4 2043
失恋的感觉
失恋的感觉 2020-12-15 06:36

I am getting this error that says jQuery is not defined. I want to use twitter bootstrap and jQuery-UI. In my I\'ve added the CSS and JS necessary.

相关标签:
4条回答
  • 2020-12-15 07:19
    <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
    <script src="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
    

    add jquery js file above bootstrap

    0 讨论(0)
  • 2020-12-15 07:27

    This is most likely because of 2 reasons:

    1. You are loading jQuery twice; remove one of them (preferably the older version).
    2. You are loading bootstrap.min.js before loading jQuery (read the documentation here).

    What you need to do is:

    <link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" />
    <link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-theme.min.css" />
    <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
    
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" />
    <script src="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js" />
    <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js" />
    
    0 讨论(0)
  • 2020-12-15 07:33

    Load jQuery before everything else!

    <link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" />
    <link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-theme.min.css" />
    <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
    
    <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    
    <script src="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
    <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
    
    0 讨论(0)
  • 2020-12-15 07:35

    I've tested this and this order seems to work the best.

    1. Load CSS
    2. Load jQuery
    3. Load Bootstrap
    4. Load jQuery UI
    0 讨论(0)
提交回复
热议问题