【发布时间】:2011-09-10 18:50:36
【问题描述】:
我正在尝试使用 json 填充我的 FullCalendar 事件。但是在尝试加载此类事件时出现错误。由于我对这一切都不熟悉,我试图只加载一个事件,而我现在什至没有从数据库中获取信息。
$('#calendar').fullCalendar({
defaultView: 'agendaWeek',
theme:true,
allDaySlot: false,
allDayText: false,
minTime: 7,
maxTime: 19,
events: {
url: 'JornadasDeportivas.php',
type: 'POST',
data: {
opcion: 'eventos',
},
error: function() {
alert('Error al cargar los eventos');
}
}
});
我的 php 代码只是调用了这个方法
function json(){
echo '
[
{
"title" : "event1",
"allDay" : false,
"start" : "2011-09-09 12:30:00",
"end" : "2011-09-09 15:30:00"
}
]
';
}
输出是
[ { "title" : "event1", "allDay" : false, "start" : "2011-09-09 12:30:00", "end" : "2011-09-09 15:30: 00" } ]
而且我总是收到错误警报。我不知道我做错了什么。Pleeeeaseee帮助! :(提前谢谢!
【问题讨论】:
标签: json fullcalendar