[英]C# ASP.NET MVC scripts being loaded in twice
我有一个 C# ASP.NET MVC 应用程序,它加载脚本两次并在控制台中给我错误。 第一次加载脚本时,它们被正确加载,但第二次,它们会导致错误。
这是浏览器控制台的屏幕截图:
这是我的布局,这是唯一调用脚本的地方:
<head>
<meta http-equiv="x-ua-compatible" content="ie=edge" charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="png/favicon.png" id="favicon-i">
@Styles.Render("~/Content/css")
@Scripts.Render("~/bundles/other")
@Scripts.Render("~/bundles/modernizr")
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/bootstrap")
@Scripts.Render("~/bundles/picker")
</head>
这是我的捆绑包,并非所有捆绑包都在使用:
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js"));
bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
"~/Scripts/jquery.validate*"));
// Use the development version of Modernizr to develop with and learn from.
// Then, when you're ready for production, use the build tool at
// https://modernizr.com to pick only the tests you need.
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
"~/Scripts/modernizr-*"));
bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
"~/Scripts/bootstrap.js",
"~/Scripts/bootstrap.min.js"));
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-3.3.1.min.js",
"~/Scripts/jquery-3.3.1.js"));
bundles.Add(new ScriptBundle("~/bundles/picker").Include(
"~/Scripts/bootstrap-datepicker.js",
"~/Scripts/bootstrap-datetimepicker.js",
"~/Scripts/bootstrap-datetimepicker.min.js",
"~/Scripts/bootstrap-multiselect.js"));
bundles.Add(new ScriptBundle("~/Scripts").Include(
"~/Scripts/tether.min.js",
"~/Scripts/tether.js",
"~/Scripts/apexcharts.min.js",
"~/Scripts/layout.js",
"~/Scripts/moment.js",
"~/Scripts/Chart.js"));
bundles.Add(new ScriptBundle("~/bundles/other").Include(
"~/Scripts/tether.min.js",
"~/Scripts/tether.js",
"~/Scripts/apexcharts.min.js",
"~/Scripts/layout.js",
"~/Scripts/moment.js",
"~/Scripts/Chart.js"));
bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/bootstrap.css", "~/Content/layout.css", "~/Content/Style.css", "~ /Content/tether.min.css", "~/Content/bootstrap-datepicker.css", "~/Content/bootstrap-datetimepicker.css", "~/Content/bootstrap-multiselect.css"));
任何想法为什么会发生这种情况?
编辑:这就是发起者的样子:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.