我正在使用fullcalendar 1.5.1和jQuery 1.6.2。之前,我使用的是jQuery 1.5,IE7-9中没有任何功能。现在IE9可以工作,但7和8不能。日历呈现自己,但事件不会。它们不在html的任何地方。
我正在使用PHP从MySQL表中动态调用我的事件。
输出如下:
$(document).ready(function() {
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
allDaySlot: false,
eventClick: function(calEvent) {
window.location = "ac_events.php?edit=" + calEvent.id;
},
events: [{
id: 1,
title: 'Dance Party',
start: '2011-07-29 21:00',
end: '2011-07-31 06:00',
allDay: false},
{
id: 2,
title: 'Meeting',
start: '2011-07-28 09:00',
end: '2011-07-28 18:00',
allDay: false},
{
id: 3,
title: 'Dinner with partners',
start: '2011-07-28 19:00',
end: '2011-07-28 21:00',
allDay: false},
{
id: 4,
title: 'Paroll Due',
start: '2011-07-28 23:00',
end: '2011-07-29 01:00',
allDay: false}, ]
});
});
我尝试的任何东西都无法实现。有人有解决方案吗?
修改
我收到以下javascript错误:
Message: 'undefined' is null or not an object
Line: 918
Char: 7
Code: 0
URI: http://[...]/javascript/fullcalendar.js
第918行:
function fetchEventSource(source, fetchID) {
_fetchEventSource(source, function(events) {
if (fetchID == currentFetchID) {
if (events) {
for (var i=0; i<events.length; i++) {
events[i].source = source; // 918
normalizeEvent(events[i]);
}
cache = cache.concat(events);
}
pendingSourceCnt--;
if (!pendingSourceCnt) {
reportEvents(cache);
}
}
});
}
答案 0 :(得分:4)
你可能会尝试在id为4的事件之后删除逗号。我知道流氓逗号可能会破坏它。
另外,你得到任何js错误吗?