我FullCalendar的jQuery看起來是這樣的:jQuery的FullCalendar不解析JSON
$(document).ready(function() {
$('#calendar').fullCalendar({
events: {
url: '/admin/index.php',
type: 'GET',
data: {
m: '1',
e: 'fetchCalEvents'
},
error: function() {
alert('there was an error while fetching events!');
},
color: 'yellow',
textColor: 'black'
}
});
如果我打的測試網址:
http://localhost/admin/index.php?m=1&e=fetchCalEvents
我得到好看的JSON:
[{"id":"13","title":"Test Entry","start":"2013-04-20 04:20:00","end":"2013-04-20 05:20:00","url":"#","allDay":false}]
但加重日曆只會彈出:
There was an error while fetching events!
這並沒有告訴我很多。有什麼方法可以在這個插件上獲得更好的錯誤處理嗎?我沒有看到文檔中的任何內容。任何想法有什麼不對?
:(