[英]Unhandled exception at line 23, column 1 in http://localhost:49997/Scripts/bootstrap.js jquery is undefined
I am loading the Register page
in which I refer the jquery
files and bootstrap.js
,but still I am getting the above error in the tile. 我正在加载“ Register page
在其中引用了jquery
文件和bootstrap.js
,但仍然在磁贴中收到上述错误。
This is to load jquery before bootstrap.so in the cshtml
page I am loading both, is this the right way to load all. 这是在bootstrap.so之前加载cshtml
页面中加载jquery,这是加载所有内容的正确方法。
Register.cshtml Register.cshtml
<head>
<script src="~/Scripts/jquery-1.10.2.intellisense.js"></script>
<script src="~/Scripts/jquery-1.10.2.js"></script>
<script src="~/Scripts/jquery-1.10.2.min.js"></script>
<script src="~/Scripts/jquery.validate-vsdoc.js"></script>
<script src="~/Scripts/jquery.validate.js"></script>
<script src="~/Scripts/jquery.validate.min.js"></script>
<script src="~/Scripts/jquery.validate.unobtrusive.js"></script>
<script src="~/Scripts/jquery.validate.unobtrusive.min.js"></script>
<script src="~/Scripts/jquery-1.10.2.min.map"></script>
<script type="text/javascript" src="~/Scripts/bootstrap.js"></script>
<title>Register</title>
</head>
You have a lot of duplicates in your script registration: 您的脚本注册中有很多重复项 :
<head>
<script src="~/Scripts/jquery-1.10.2.intellisense.js"></script>
<script src="~/Scripts/jquery-1.10.2.js"></script>
<script src="~/Scripts/jquery-1.10.2.min.js"></script>
<script src="~/Scripts/jquery.validate-vsdoc.js"></script>
<script src="~/Scripts/jquery.validate.js"></script>
<script src="~/Scripts/jquery.validate.min.js"></script>
<script src="~/Scripts/jquery.validate.unobtrusive.js"></script>
<script src="~/Scripts/jquery.validate.unobtrusive.min.js"></script>
<script src="~/Scripts/jquery-1.10.2.min.map"></script>
<script type="text/javascript" src="~/Scripts/bootstrap.js"></script>
<title>Register</title>
</head>
Sometimes, the browser doesn't like duplicates so much, it corresponds in bootstrap not working and jquery throwing exceptions. 有时,浏览器不太喜欢重复项,它对应于引导不起作用和jquery抛出异常。
Try to remove the duplicates, wherever you have a call to min.js and to .js of the same file, remove one of them so you will have, for example: 尝试删除重复项,无论您在哪里调用同一文件的min.js和.js,都请删除其中之一,例如:
<head>
<script src="~/Scripts/jquery-1.10.2.intellisense.js"></script>
<script src="~/Scripts/jquery-1.10.2.js"></script>
<script src="~/Scripts/jquery.validate-vsdoc.js"></script>
<script src="~/Scripts/jquery.validate.js"></script>
<script src="~/Scripts/jquery.validate.unobtrusive.js"></script>
<script src="~/Scripts/jquery-1.10.2.min.map"></script>
<script type="text/javascript" src="~/Scripts/bootstrap.js"></script>
<title>Register</title>
</head>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.