I am trying to load events, that I have in my database, to my calendar but my little knowledge makes me not find the error
`My Menu Servlet code`
ArrayList<DTO> list = ges.FechasAlquileresAdeudados();
Gson jsonList = new Gson();
String json = jsonList.toJson(list);
PrintWriter out = response.getWriter();
out.println(json);
/// JS code ///
$('#calendar').fullCalendar({
header: { ... },
drop: function (date, allDay) { ... },
events: BuscarVtos()
});
}();
function BuscarVtos() {
$.ajax({
url: 'Menu',
type: 'POST',
contentType: 'application/x-www-form-urlencoded; charset=utf-8',
datatype: 'json',
success: function (resultado) {
if (resultado !== "[]\r\n") {
var json = eval('(' + resultado + ')');
}
}
});
}
;
the ajax response is
[
{
"title": "Title 1",
"start": "2022-11-05T00:00:00",
"url": "http://localhost:26231/Sistem1"
},
{
"title": "Title 1",
"start": "2022-11-10T00:00:00",
"url": "http://localhost:26231/Sistem2"
},
{
"title": "Title 1",
"start": "2022-11-09T00:00:00",
"url": "http://localhost:26231/Sistem3"
}
]
but it does not recognize the data and therefore does not enter the events to the calendar Any Helpme