Я ищу почти все связанные ошибки здесь в отношении Fullcalendar.
У меня есть этот JQuery, это из этой документации https://fullcalendar.io/docs/events-function
$('#calendar').fullCalendar({
events: function(start, end, timezone, callback) {
$.ajax({
type: "POST",
url: "api/test.php",
success: function(doc) {
var events = [];
$(doc).find('event').each(function() {
events.push({
title: $(this).attr('title'),
start: $(this).attr('start') // will be parsed
});
});
callback(events);
}
});
}
});
Но всякий раз, когда я пытаюсь запустить этокод, он ничего не возвращает в моем календаре и имеет эту ошибку в консоли
VM8547 jquery-2.2.3.min.js:2 Uncaught Error: Syntax error, unrecognized
expression:
{
"event": [
{
"title": "test 1",
"start": "2015-10-20",
"end": "2015-10-20"
},
{
"title": "test 2",
"start": "2016-04-18",
"end": "2016-04-18"
},
{
"title": "test 3",
"start": "2017-07-22",
"end": "2017-07-22"
},
{
"title": "test 4",
"start": "0000-00-00",
"end": "0000-00-00"
},
{
"title": "test 5",
"start": "2015-08-26",
"end": "2015-08-26"
},
{
"title": "test 6",
"start": "0000-00-00",
"end": "0000-00-00"
},
{
"title": "test 7",
"start": "2018-01-10",
"end": "2018-01-10"
},
{
"title": "8",
"start": "2018-07-09",
"end": "2018-07-09"
},
{
"title": "test 9",
"start": "2018-05-28",
"end": "2018-05-28"
},
{
"title": "test 10",
"start": "2016-03-10",
"end": "2016-03-10"
}
]
}
at Function.fa.error (VM8547 jquery-2.2.3.min.js:2)
at fa.tokenize (VM8547 jquery-2.2.3.min.js:2)
at fa.select (VM8547 jquery-2.2.3.min.js:2)
at Function.fa [as find] (VM8547 jquery-2.2.3.min.js:2)
at n.fn.init.find (VM8547 jquery-2.2.3.min.js:2)
at new n.fn.init (VM8547 jquery-2.2.3.min.js:2)
at n (VM8547 jquery-2.2.3.min.js:2)
at Object.success (?page=test-kim:1882)
at i (VM8547 jquery-2.2.3.min.js:2)
at Object.fireWith [as resolveWith] (VM8547 jquery-2.2.3.min.js:2)
Я не могу найти проблему здесь.Я попытался прочитать почти все исправления, которые смог найти, но ничего не помогло.