我的 FullCalendar jQuery 看起来像这样:
$(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!
这并没有告诉我太多。有没有办法在这个插件上获得更好的错误处理?我在文档中没有看到任何内容。知道有什么问题吗?
:(