https://jqueryui.com/datepicker/
jQuery UI datepicker如上所示,但我的版本如下所示。
我的jQuery文件是
public class BundleConfig
{
// For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
/*"~/Scripts/jquery-{version}.js",*/
"~/Scripts/jquery-1.12.4.min.js"));
bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include(
//"~/Scripts/jquery-ui-{version}.js",
// "~/Scripts/jquery-ui-*",
"~/Scripts/jquery.switchButton.js",
"~/Scripts/jquery-ui.min.js"
));
bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
"~/Scripts/jquery.validate*"));
bundles.Add(new ScriptBundle("~/bundles/dataTables").Include(
"~/Scripts/media/js/jquery.dataTables.js"));
bundles.Add(new ScriptBundle("~/bundles/moment").Include(
"~/Scripts/moment.js"));
// Use the development version of Modernizr to develop with and learn from. Then, when you're
// ready for production, use the build tool at http://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/respond.js"));
bundles.Add(new StyleBundle("~/Content/css").Include(
"~/Content/bootstrap.css",
"~/Content/site.css"));
}
}
}
我添加了jQuery和jQuery UI的最新稳定版本,并更改了bundle配置以避免重复错误(这是我必须从Uncaught TypeError: undefined is not a function in datepicker开始)
一个StackOverflow回答说,moment.js应该高于jQuery UI,但我没有发现任何变化,现在我完全难过,因为之前看不到jQuery UI部分工作。请帮忙!
答案 0 :(得分:2)