【发布时间】:2012-03-17 03:14:54
【问题描述】:
我正在尝试将 fullcalendar 和 datepicker 链接在一起,为自己形成一个不错的日历,但我的代码遇到了以下错误:
错误信息:
$("#datepicker").datepicker 不是函数
这是我的代码:
<link rel='stylesheet' type='text/css' href='../fullcalendar/fullcalendar.css' />
<link rel='stylesheet' type='text/css' href='../fullcalendar/fullcalendar.print.css' media='print' />
<link href="../scripts/jquery-ui-1.7.3.custom.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="../Styles/dark-hive/jquery.ui.all.css">
<script src="../jquery/jquery-1.7.1.js"></script>
<script type='text/javascript' src='../jquery/jquery-ui-1.8.17.custom.min.js'></script>
<script src="../jquery/ui/jquery.ui.core.js"></script>
<script src="../scripts/ui/jquery.ui.datepicker.js"></script>
<script type='text/javascript' src='../fullcalendar/fullcalendar.min.js'></script>
<script type='text/javascript'>
$(function() {
$('#calendar').fullCalendar({
theme: true,
header: {
left: '',
center: '',
right: ''
},
defaultView: 'agendaDay',
editable: false,
events: "../fullcalendar/JSONcreator"
});
$('#datepicker').datepicker({
inline: true,
onSelect: function(dateText, inst) {
var d = new Date(dateText);
$('#calendar').fullCalendar('gotoDate', d);
}
});
})
</script>
另外,有没有办法摆脱顶部的一些 JQuery 脚本调用?太多了,看起来很乱,但是我是JQuery的新手。
【问题讨论】:
-
你不应该在你的 fullcalendar 插件之前加载 jquery 吗?
-
我想我现在已经这样做了(上面的代码反映了我的更改),但是错误仍然存在。感谢您的回复!
标签: javascript jquery css datepicker fullcalendar