【发布时间】:2014-06-04 12:22:15
【问题描述】:
我从它的网站下载了modernizr.js。
<html>
<head>
<title>Hello Modernizr</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="~/modernizr.custom.62854.js"></script>
</head>
<body>
</body>
</html>
<script>
Modernizr.load({
test: Modernizr.inputtypes.date,
nope: ['http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/jquery-ui.min.js', 'jquery-ui.css'],
complete: function () {
$('input[type=date]').datepicker({
dateFormat: 'yy-mm-dd'
});
}
});
</script>
我添加了一个日期选择器,但如果我运行网站,我看不到任何我想念的地方?
【问题讨论】:
-
您需要做的第一件事是将
script块移动到body标签内 -
你得到什么错误?
-
第二点,我在你的 HTML 中没有看到任何
input[type=date] -
添加
<input/>元素! -
能否请您用html代码回答,如果您能提供帮助,我将接受最佳答案谢谢
标签: javascript jquery html datepicker modernizr