I am trying to fill my FullCalendar with events using json. But I get an error when trying to load such events. Since I am new to all of this I was trying to load just a single event and I am not even getting the info from a database for now.
$('#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');
}
}
});
My php code is just calling this method
function json(){
echo '
[
{
"title" : "event1",
"allDay" : false,
"start" : "2011-09-09 12:30:00",
"end" : "2011-09-09 15:30:00"
}
]
';
}
and the output is
[ { "title" : "event1", "allDay" : false, "start" : "2011-09-09 12:30:00", "end" : "2011-09-09 15:30:00" } ]
and I always get the error alert. I don't know what I'm doing wrong.Pleeeeaseee help!!! :( Thanks in advance!