以下结果:未捕获类型错误:无法读取未定义的属性“formatDate”
我将所有三个文件都放在同一目录中(jquery、jquery-ui 和此 html 文件):
<html>
<head>
<link rel="stylesheet" href="jquery-ui.min.css">
<script src="jquery-1.11.1.min.js"</script>
<script src="jquery-ui.min.js"</script>
<script>
$(document).ready(function(){
var $t = $.datepicker.formatDate("M dd", new Date("2014-12-01"));
console.log($t);
});
</script>
</head>
<body>
</body>
</html>
我做错了什么?
最佳答案
如果这是您实际的 HTML,您应该更改
<script src="jquery-1.11.1.min.js"</script>
<script src="jquery-ui.min.js"</script>
进入
<script src="jquery-1.11.1.min.js"></script>
<script src="jquery-ui.min.js"></script>
关于javascript - 如何使用 jQuery UI datepicker.format,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26768162/