我正在使用bundleconfig.cs类向我的应用添加一些jQuery脚本文件.
bundles.Add(new ScriptBundle("~/bundles/jquery").Include( "~/Scripts/jquery-{version}.js","~/Scripts/jquery-ui-{version}.js","~/Scripts/jquery.mCustomScrollbar.min.js","~/Scripts/jquery.mousewheel.min.js","~/Scripts/jtable/jquery.jtable.js"));
<script src="/Scripts/jquery-1.10.2.js"></script> <script src="/Scripts/jquery-ui-1.10.3.js"></script> <script src="/Scripts/jtable/jquery.jtable.js"></script> <script src="/Scripts/jquery-migrate-1.2.1.min.js"></script>
解决方法
.min部分已由MVC处理 – 它将自动包含调试模式的.js文件和释放模式的.min.js文件.
只需下载jquery.mCustomScrollbar.min.js的未编译版本并将其放在您的脚本目录中,然后将其引用为:
jquery.mCustomScrollbar.js
bundles.Add(new ScriptBundle("~/bundles/jquery").Include( "~/Scripts/jquery-{version}.js","~/Scripts/jquery.mCustomScrollbar.js","~/Scripts/jquery.mousewheel.js","~/Scripts/jtable/jquery.jtable.js"));
然后,MVC将加载适当的Debug / Release脚本