我試圖從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);
}
});
}
});
});
我會很感激任何幫助,您可以給我。謝謝!