我试图从MySQL数据库显示我的事件。我正在使用事件功能。我返回的XML文件非常基础。我查看了所有FullCalendar问题,其中大部分都讨论JSON并指向JSON的文档。我无法使用JSON。我必须去XML。你能告诉我我在哪里吗?FullCalendar和事件:函数
这里是什么我的XML看起来像一个示例:
<id><id>
<title>Grow Your Business on the Web</title> <br>
<start>2010-06-05T9:30</start> <br>
<end>2010-06-05T12:30</end> <br>
<className>O</className> <br>
<url></url>
整个文件是以一<event
>标签,并用</event
>标签关闭。
我jQuery是如下:
$(document).ready(function() {
$('#calendar').fullCalendar({
height: 550,
theme: true,
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
editable: true,
events: function(start, end, callback) {
$.ajax({
url: 'ncludeFiles/sbdp-cal-xml.php',
dataType: 'xml',
data: {
// our hypothetical feed requires UNIX timestamps
start: Math.round(start.getTime()/1000),
end: Math.round(end.getTime()/1000)
},
success: function(doc) {
var events = [];
$(doc).find('event').each(function() {
events.push({
title: $(this).attr('title'),
start: $(this).attr('start'),
end: $(this).attr('end'),
className: $(this).attr('className'),
url: $(this).attr('url')
});
});
callback(events);
}
});
}
});
});
我会很感激任何帮助,您可以给我。谢谢!