简体   繁体   中英

Bootstrap error message Error: Bootstrap's JavaScript requires jQuery

I am trying to learn bootstrap and seem to be having a problem setting it up properly. I am getting an error:

Line: 8 Error: Bootstrap's JavaScript requires jQuery

I have checked for this error message on this site and have read several responses but from what I have read it appears I have my setup correct. Can anyone see a problem with the code and let me know how I can fix it?

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" 
    Inherits="WebApplication2.WebForm1" %>

<!DOCTYPE html>

<html lang="en">
<head runat="server">
     <!-- metadata -->
    <meta charset="UTF-8"/>

         <!-- responsive -->
            <meta name="viewport" content="width=device-width, initial-scale=1"/>
        <!-- [/] responsive -->

    <!-- [/] metadata -->
    <link href="Scripts/bootstrap.css" rel="stylesheet" />
    <title> Test</title>
    </head>
    <body>
    <form id="form1" runat="server">
        <div>
        </div>
    </form>

<script src="Scripts/jquery-3.3.1.js"></script>
<script src="Scripts/bootstrap.js"></script> 

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

Use the above CDN in general to access Bootstrap Classes and Jquery Functionalities.

After doing more reading and reviewing all the comments from users I found the issue was my IE browser, for some reason was rendering the page as IE-7. After adding

<meta http-equiv="X-UA-Compatible" content="IE=11" />

to my page the problem was solved.

Better to include jquery migrate Use

<script src="Scripts/jquery-3.3.1.js"></script>
<script src="https://code.jquery.com/jquery-migrate-3.0.1.js"></script>
<script src="Scripts/bootstrap.js"></script> 

Try this

Change the order of files it should be like below.

<script src="js/jquery-1.11.0.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/wow.min.js"></script>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM