[英]bootstrap javascript requires jquery error
This is my .cshtml code 这是我的.cshtml代码
<!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. 每当我执行我的代码时,它给出的引导都需要jquery错误。 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 确保路径正确并指向大于1.9的jQuery版本
You are using 1.8 which is not compatible with bootstrap 您正在使用与引导程序不兼容的1.8
Source: 资源:
https://github.com/twbs/bootstrap/blob/v3.1.1/bower.json 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. 就像Amit Joki所说的那样,请确保将链接直接链接到jquery文件,并且文件名也相应地拼写。 Also ensure that you link jquery js script before you link to the bootstrap js script
还要确保在链接到引导js脚本之前先链接jquery js脚本
<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" />
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.