简体   繁体   中英

bootstrap javascript requires jquery error

This is my .cshtml code

    <!DOCTYPE Html>
    <html>
        <head>
            <meta charset="utf-8" />
            <meta name="viewport" content="width=device-width" />
            <title>welcome</title>
            <link href="~/Content/bootstrap.css" rel="stylesheet" />
            <script src="~/Scripts/jquery-1.8.0.min.js"></script>
            <script src="~/Scripts/bootstrap.js"></script>
       </head>
       <body>...</body>
    </html>

Whenever I execute my code it gives the bootstrap requires jquery error. Please suggest what should I do to remove this error.

Make sure that the path is correct and points to jQuery version greater than 1.9

You are using 1.8 which is not compatible with bootstrap

Source:

https://github.com/twbs/bootstrap/blob/v3.1.1/bower.json

Just as Amit Joki said, make sure you link points directly to the jquery file and the file name is spelt accordingly. Also ensure that you link jquery js script before you link to the bootstrap js script

<script src="path_to_script/jquery-1.8.0.min.js"></script>
<script src="path_to_script/bootstrap.js"></script>
<link href="path_to_script/bootstrap.css" rel="stylesheet" />

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