user3719840
user3719840

Reputation: 31

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.

Upvotes: 1

Views: 12663

Answers (2)

Joshua
Joshua

Reputation: 866

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" />

Upvotes: 0

Amit Joki
Amit Joki

Reputation: 59282

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

Upvotes: 5

Related Questions